/* ================= login ================= */
.login-page {
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 12%;
  background: linear-gradient(160deg, #f6f5ff 0%, var(--bg) 65%);
  border-right: 1px solid var(--border);
}
.login-logo {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--accent);
}
.login-tagline {
  margin-top: 8px;
  font-size: 15px;
  color: var(--text-2);
}
.login-feats {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-3);
  font-size: 13px;
}
.login-feats li::before {
  content: "—";
  color: var(--accent);
  margin-right: 8px;
}
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 320px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fade-up var(--t-med) var(--ease);
}
.login-card h2 { font-size: 17px; margin-bottom: 14px; }
.login-card .btn { width: 100%; margin-top: 6px; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= projects ================= */
.pj-page { min-height: 100vh; display: flex; flex-direction: column; }

.pj-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.pj-brand { font-weight: 700; font-size: 15px; color: var(--accent); }
.pj-spacer { flex: 1; }
.pj-user { color: var(--text-2); font-size: 12px; }

.pj-grid-wrap { padding: 24px; }
.pj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  max-width: 1280px;
  margin: 0 auto;
}

.pj-card {
  position: relative;
  padding: 16px 16px 14px 19px;
  cursor: pointer;
  transition: box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  overflow: hidden;
  animation: fade-up var(--t-med) var(--ease);
}
.pj-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--border-strong);
  transition: background var(--t-fast) var(--ease);
}
.pj-card.h-ok::before { background: var(--ok); }
.pj-card.h-warn::before { background: var(--warn); }
.pj-card.h-crit::before { background: var(--crit); }
.pj-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }

.pj-card-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.pj-name { font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pj-health { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 10px; }
.pj-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border-strong);
  display: inline-block;
}
.pj-dot.ok { background: var(--ok); }
.pj-dot.warn { background: var(--warn); }
.pj-dot.crit { background: var(--crit); }

.pj-meta {
  display: flex;
  justify-content: space-between;
  color: var(--text-2);
  font-size: 12px;
  margin-bottom: 8px;
}
.pj-delta { color: var(--crit); font-weight: 600; }
.pj-pct { font-size: 11px; margin-top: 6px; }

.pj-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 90px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.pj-empty-mark { font-size: 40px; color: var(--accent); opacity: 0.4; }

.np-res-row { display: flex; gap: 6px; margin-bottom: 6px; }
.np-res-row .np-res-name { flex: 1; }
.np-res-row .np-res-cap { width: 80px; }

/* ================= gantt ================= */
.gantt { display: block; font-family: var(--font); }

.gantt .row-alt { fill: rgba(0, 0, 0, 0.014); }
.gantt .weekend { fill: rgba(24, 24, 27, 0.03); }
.gantt .grid-line { stroke: var(--border); stroke-width: 1; }
.gantt .header-bg { fill: var(--panel); }
.gantt .header-line { stroke: var(--border); }
.gantt .header-month { font-size: 11px; fill: var(--text-2); font-weight: 600; }
.gantt .header-tick { font-size: 10px; fill: var(--text-3); }

.gantt .today-line {
  stroke: var(--crit);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.7;
}
.gantt .today-tag rect { fill: var(--crit); opacity: 0.9; }
.gantt .today-text { font-size: 9px; fill: #fff; }

.gantt .baseline-bar { fill: var(--border-strong); }

.gantt-bar { transition: opacity var(--t-fast) var(--ease), transform var(--t-med) var(--ease); }
.gantt-bar .bar-shape { fill: #a5b4fc; }
.gantt-bar .bar-progress { fill: var(--accent); pointer-events: none; }
.gantt-bar.type-supply .bar-shape { fill: var(--supply); opacity: 0.75; }
.gantt-bar.type-milestone .bar-shape { fill: #0ea5e9; }
.gantt-bar.done .bar-shape { fill: var(--ok); opacity: 0.8; }
.gantt-bar.affected .bar-shape { fill: var(--warn); }
.gantt-bar.crit .bar-shape { stroke: var(--crit); stroke-width: 1.5; }
.gantt-bar.selected .bar-shape {
  stroke: var(--accent);
  stroke-width: 2;
  filter: drop-shadow(0 1px 3px rgba(79, 70, 229, 0.35));
}
.gantt-bar .bar-label { font-size: 11px; fill: var(--text-2); pointer-events: none; }
.gantt-bar { cursor: pointer; }
.gantt-bar.dim { opacity: 0.22; }

.gantt .dep-arrow {
  fill: none;
  stroke: #c0c3cb;
  stroke-width: 1.2;
  transition: opacity var(--t-fast) var(--ease), stroke var(--t-fast) var(--ease);
}
.gantt .dep-arrow.hot { stroke: var(--accent); stroke-width: 1.6; }
.gantt .dep-arrow.dim { opacity: 0.15; }
.gantt .arrowhead { fill: #c0c3cb; }
.gantt .dep-arrow.hot ~ defs .arrowhead { fill: var(--accent); }

/* ================= workbench ================= */
.wb-page { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

.wb-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  flex: none;
  padding: 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.wb-title { font-size: 14px; font-weight: 600; }
.wb-end { font-size: 12px; font-variant-numeric: tabular-nums; }

.wb-seg {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.wb-seg button {
  border: none;
  background: var(--panel);
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font);
}
.wb-seg button + button { border-left: 1px solid var(--border); }
.wb-seg button.on { background: var(--accent); color: #fff; }

.wb-warnings {
  flex: none;
  padding: 6px 16px;
  background: #fef2f2;
  border-bottom: 1px solid #fecaca;
  color: var(--crit);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wb-simbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  font-size: 12.5px;
  animation: fade-up var(--t-fast) var(--ease);
}
.wb-simbar-tag {
  background: var(--warn);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.wb-body { flex: 1; display: flex; min-height: 0; }

.wb-tasklist {
  width: 220px;
  flex: none;
  overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 6px 0;
  transition: width var(--t-med) var(--ease), padding var(--t-med) var(--ease);
}
.wb-tasklist.collapsed { width: 0; padding: 0; overflow: hidden; border-right: none; }

.wb-task {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  border-left: 2px solid transparent;
}
.wb-task:hover { background: var(--bg); }
.wb-task.on { background: #eef2ff; border-left-color: var(--accent); }
.wb-task-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.wb-task-dates { font-size: 11px; font-variant-numeric: tabular-nums; }
.pj-dot.accent { background: var(--accent); }

.wb-gantt-wrap { flex: 1; overflow: auto; min-width: 0; }

.wb-right {
  width: 320px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--border);
  min-height: 0;
}
.wb-detail { flex: 1; overflow-y: auto; padding: 14px; min-height: 0; }
.wb-chat {
  flex: none;
  height: 42%;
  min-height: 200px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ================= sidebar（右栏详情） ================= */
.sb-empty { text-align: center; padding: 40px 12px; font-size: 12.5px; }

.sb-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sb-head h3 { font-size: 14px; flex: 1; }

.sb-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 12px; }
.sb-table td { padding: 4px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.sb-table td:first-child { color: var(--text-3); width: 78px; }
.sb-table td:last-child { font-variant-numeric: tabular-nums; }

.sb-deps { font-size: 12px; display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.sb-dep { color: var(--accent); cursor: pointer; }
.sb-dep:hover { text-decoration: underline; }

.sb-events h4, .sb-whatif h4 { font-size: 12px; margin-bottom: 6px; }
.sb-events ul { list-style: none; padding: 0; margin: 0 0 12px; font-size: 12px; display: flex; flex-direction: column; gap: 6px; }

.sb-whatif {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.sb-whatif-row { display: flex; gap: 6px; margin-bottom: 8px; }
.sb-whatif-row select { flex: 1; }

/* ================= chat ================= */
.chat-head {
  flex: none;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.chat-msg {
  max-width: 88%;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.55;
  animation: fade-up var(--t-fast) var(--ease);
  word-break: break-word;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.chat-msg.assistant {
  align-self: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
}
.chat-msg.assistant p { margin: 0 0 4px; }
.chat-msg.assistant p:last-child { margin-bottom: 0; }
.chat-msg.assistant ul { margin: 2px 0 4px; padding-left: 18px; }
.chat-msg.assistant code, .chat-msg.guide code {
  background: #eef2ff;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 11.5px;
}
.chat-code {
  background: #18181b;
  color: #e4e4e7;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  overflow-x: auto;
  margin: 4px 0;
}
.chat-msg.error { border-color: #fecaca; background: #fef2f2; }
.chat-msg.error .chat-retry { margin-left: 6px; }
.chat-msg.guide {
  align-self: stretch;
  max-width: none;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: var(--text-2);
}

.chat-dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.chat-dots i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-3);
  animation: chat-bounce 1.2s infinite;
}
.chat-dots i:nth-child(2) { animation-delay: 0.15s; }
.chat-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-3px); opacity: 1; }
}

.chat-inputbar {
  flex: none;
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  align-items: flex-end;
}
.chat-inputbar textarea {
  flex: 1;
  resize: none;
  max-height: 90px;
  font-size: 12.5px;
}

/* ================= wizard ================= */
.wz-dialog { width: 720px; max-width: 92vw; }

.wz-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.wz-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}
.wz-step i {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 11px;
}
.wz-step.on { color: var(--text); font-weight: 600; }
.wz-step.on i { background: var(--accent); border-color: var(--accent); color: #fff; }
.wz-step.done i { background: var(--ok); border-color: var(--ok); color: #fff; }
.wz-step-line { flex: 1; height: 1px; background: var(--border); }

.wz-warnings {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wz-table-wrap { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.wz-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.wz-table th {
  text-align: left;
  padding: 6px 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  position: sticky;
  top: 0;
}
.wz-table td { padding: 3px 6px; border-bottom: 1px solid var(--border); }
.wz-table tr.warned td { background: #fffbeb; }
.wz-table input, .wz-table select { font-size: 12px; padding: 3px 6px; width: 100%; }

.wz-subhead { font-size: 12px; margin: 12px 0 6px; }
.wz-edges { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; max-height: 90px; overflow-y: auto; }
.wz-edge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--bg);
}
.wz-edge-del {
  border: none; background: none; cursor: pointer;
  color: var(--text-3); font-size: 11px; padding: 0 2px;
}
.wz-edge-del:hover { color: var(--crit); }

.wz-spin {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wz-rot 0.8s linear infinite;
  vertical-align: -2px;
}
@keyframes wz-rot { to { transform: rotate(360deg); } }

.wz-done { text-align: center; padding: 20px 0 4px; }
.wz-done-mark {
  width: 44px; height: 44px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wz-done p { margin: 8px 0 12px; font-size: 13px; color: var(--text-2); }

/* ================= attention（首页待确认清单） ================= */
.att { max-width: 1280px; margin: 0 auto 18px; padding: 14px 16px; }
.att-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.att-head h3 { font-size: 13px; }
.att-count {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  padding: 1px 6px;
}

.att-list { list-style: none; margin: 0; padding: 0; }
.att-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  font-size: 12.5px;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--border);
}
.att-item:last-child { border-bottom: none; }
.att-item.lv-crit { border-left-color: var(--crit); background: #fef2f2; }
.att-item.lv-warn { border-left-color: var(--warn); }
.att-item.lv-info { color: var(--text-2); }

.att-pj { flex: none; }
.att-node { color: var(--accent); cursor: pointer; font-weight: 600; white-space: nowrap; }
.att-node:hover { text-decoration: underline; }
.att-msg { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-msg b { color: var(--text); }
.att-item.lv-crit .att-msg b { color: var(--crit); }
.att-act { flex: none; }

/* ================= members（组织/项目成员） ================= */
.mb-dialog { width: 560px; max-width: 92vw; }
.mb-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 10px 0; }
.mb-table th {
  text-align: left; padding: 6px 8px; background: var(--bg);
  border-bottom: 1px solid var(--border); font-weight: 600;
}
.mb-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.mb-table tr.mb-disabled td { opacity: 0.55; }
.mb-actions { text-align: right; white-space: nowrap; }
.mb-actions .btn { margin-left: 4px; }
.mb-newrow { display: flex; gap: 6px; margin: 10px 0 4px; }
.mb-newrow input, .mb-newrow select { flex: 1; }
.mb-hint { font-size: 11.5px; margin-top: 8px; }

.np-cal-row { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 400; }
.np-cal-row input[type="checkbox"] { width: auto; }

.wz-table td input.warned { background: #fef9c3; border-color: #fde047; }

/* ================= chat steps（执行过程时间线） ================= */
.chat-steps { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.chat-steps .step { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.chat-steps .step::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  flex: none;
  background: var(--border-strong);
}
.chat-steps .step.status::before {
  background: var(--accent);
  animation: chat-pulse 1s infinite;
}
.chat-steps .step.tool.running::before {
  background: var(--accent);
  animation: chat-pulse 1s infinite;
}
.chat-steps .step.tool.done { color: var(--text); }
.chat-steps .step.tool.done::before {
  background: var(--ok);
}
@keyframes chat-pulse { 50% { opacity: 0.3; } }

.chat-msg.pending { min-width: 200px; }
.chat-msg.pending .chat-cancel { margin-top: 6px; }

.chat-trace { margin-bottom: 8px; }
.chat-trace summary {
  cursor: pointer;
  font-size: 11.5px;
  color: var(--text-3);
  user-select: none;
}
.chat-trace[open] summary { margin-bottom: 6px; }


/* ================= chat markdown/抽屉 ================= */
.chat-tablewrap { overflow-x: auto; margin: 6px 0; }
.chat-md-table { border-collapse: collapse; font-size: 11.5px; min-width: 100%; }
.chat-md-table th, .chat-md-table td {
  border: 1px solid var(--border);
  padding: 4px 8px;
  text-align: left;
  white-space: nowrap;
}
.chat-md-table th { background: var(--bg); font-weight: 600; }
.chat-md-table tbody tr:nth-child(even) td { background: rgba(0, 0, 0, 0.015); }
.chat-msg.assistant:has(.chat-tablewrap) { max-width: 100%; align-self: stretch; }
.chat-h { font-size: 12.5px; margin: 8px 0 4px; }
h5.chat-h { font-size: 12px; }
h6.chat-h { font-size: 11.5px; color: var(--text-2); }
.chat-msg.assistant ol { margin: 2px 0 4px; padding-left: 20px; }

.wb-right { position: relative; }
.wb-chat.expanded {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 560px;
  max-width: 90vw;
  height: auto;
  z-index: 20;
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 32px rgba(24, 24, 27, 0.14);
}

/* ================= buffer（缓冲占位） ================= */
.gantt .hatch-bg { fill: #eef2ff; }
.gantt .hatch-line { stroke: #a5b4fc; stroke-width: 2; }
.gantt-bar.type-buffer .bar-shape {
  fill: url(#gantt-hatch);
  stroke: var(--text-3);
  stroke-width: 1;
  stroke-dasharray: 3 2;
}
.gantt-bar .bar-consumed { fill: var(--warn); opacity: 0.85; pointer-events: none; }
.sb-buffer { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.sb-buffer h4 { font-size: 12px; margin-bottom: 6px; }

/* ================= structure（左栏迷你 DAG） ================= */
.wb-list-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 2;
}
.wb-seg-sm button { padding: 2px 10px; font-size: 11.5px; }
.wb-list-head .btn { margin-left: auto; font-size: 11.5px; }

.wb-struct-svg { display: block; font-family: var(--font); }
.struct-lv { font-size: 9px; fill: var(--text-3); }

.struct-edge {
  fill: none;
  stroke: #c0c3cb;
  stroke-width: 1.1;
}
.struct-edge.crit { stroke: var(--crit); stroke-width: 1.5; opacity: 0.75; }

.struct-node { cursor: pointer; }
.struct-node .struct-shape {
  fill: #c7d2fe;
  stroke: var(--accent);
  stroke-width: 1;
}
.struct-node.t-supply .struct-shape { fill: #ddd6fe; stroke: var(--supply); }
.struct-node.t-milestone .struct-shape { fill: #bae6fd; stroke: #0284c7; }
.struct-node.t-buffer .struct-shape {
  fill: #eef2ff;
  stroke: var(--text-3);
  stroke-dasharray: 3 2;
}
.struct-node.done .struct-shape { fill: var(--ok); stroke: var(--ok); opacity: 0.75; }
.struct-node.crit .struct-shape { stroke: var(--crit); stroke-width: 1.8; }
.struct-node .struct-ring { fill: none; stroke: none; }
.struct-node.selected .struct-ring { stroke: var(--accent); stroke-width: 2; }
.struct-node:hover .struct-shape { filter: brightness(0.94); }
.struct-label { font-size: 9px; fill: var(--text-2); pointer-events: none; }
.struct-node.crit .struct-label { fill: var(--crit); }

/* ================= report（报工区） ================= */
.sb-report { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.sb-report h4 { font-size: 12px; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.sb-report-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.sb-report-row input[type="date"] { flex: 1; }
.sb-report-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.sb-pctv { font-size: 12px; min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

/* ================= 事实/计划三态 ================= */
.gantt-bar.planned .bar-shape {
  fill-opacity: 0.3;
  stroke: #818cf8;
  stroke-width: 1;
  stroke-dasharray: 4 3;
}
.gantt-bar.planned.type-supply .bar-shape { stroke: var(--supply); }
.gantt-bar.planned.type-milestone .bar-shape { stroke: #0284c7; stroke-dasharray: 3 2; }
.gantt-bar.active .bar-shape {
  fill-opacity: 0.32;
  stroke: var(--accent);
  stroke-width: 1;
}
.gantt-bar .bar-actual { fill: var(--accent); pointer-events: none; }
.gantt-bar.type-supply .bar-actual { fill: var(--supply); }
.gantt-bar .bar-late-cap { fill: var(--warn); pointer-events: none; }
/* 关键路径与选中描边优先级最高（后置覆盖 planned/active 的描边） */
.gantt-bar.crit .bar-shape { stroke: var(--crit); stroke-width: 1.5; stroke-dasharray: none; }
.gantt-bar.planned.crit .bar-shape { stroke-dasharray: 4 3; }
.gantt-bar.selected .bar-shape { stroke: var(--accent); stroke-width: 2; }

.wb-task.done .wb-task-name { text-decoration: line-through; color: var(--text-3); }

/* 今天线是装饰层，不拦截条的点击 */
.gantt .g-today { pointer-events: none; }

/* ================= admin（管理后台） ================= */
.ad-main { max-width: 1080px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.ad-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.ad-card { padding: 14px 16px; }
.ad-card-v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ad-card-k { font-size: 12px; color: var(--text-2); margin: 2px 0; }
.ad-section { padding: 16px; }
.ad-section h3 { font-size: 13px; margin-bottom: 10px; display: flex; gap: 8px; align-items: baseline; }
.ad-prov-form { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }

/* ================= UI 打磨：深靛控制台顶栏（签名元素） ================= */
.pj-topbar, .wb-toolbar {
  background: var(--topbar);
  border-bottom: none;
  color: var(--topbar-text);
}
.pj-brand { color: #fff; letter-spacing: -0.3px; }
.pj-topbar .muted, .wb-toolbar .muted,
.pj-user, .wb-end, .wb-stats { color: var(--topbar-muted); }
.wb-title { color: #fff; }
.wb-stats b, .wb-end b { color: var(--topbar-text); }
.pj-topbar .badge, .wb-toolbar .badge {
  background: rgba(255, 255, 255, 0.12);
  color: var(--topbar-text);
  border: none;
}
/* 顶栏内按钮：深底适配 */
.pj-topbar .btn, .wb-toolbar .btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--topbar-line);
  color: var(--topbar-text);
}
.pj-topbar .btn:hover, .wb-toolbar .btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}
.pj-topbar .btn-primary, .wb-toolbar .btn-primary {
  background: #fff;
  border-color: #fff;
  color: #312e81;
  font-weight: 600;
}
.pj-topbar .btn-primary:hover, .wb-toolbar .btn-primary:hover { background: #eef2ff; }
.pj-topbar .btn-ghost, .wb-toolbar .btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--topbar-muted);
}
.pj-topbar .btn-ghost:hover, .wb-toolbar .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.wb-seg { border-color: var(--topbar-line); }
.wb-seg button { background: transparent; color: var(--topbar-muted); }
.wb-seg button + button { border-left-color: var(--topbar-line); }
.wb-seg button.on { background: #fff; color: #312e81; font-weight: 600; }
/* 左栏内的小分段控件恢复浅色（不在顶栏里） */
.wb-tasklist .wb-seg { border-color: var(--border); }
.wb-tasklist .wb-seg button { background: var(--panel); color: var(--text-2); }
.wb-tasklist .wb-seg button + button { border-left-color: var(--border); }
.wb-tasklist .wb-seg button.on { background: var(--accent); color: #fff; font-weight: 400; }

/* 登录页品牌区呼应顶栏 */
.login-brand {
  background: var(--topbar);
  border-right: none;
}
.login-logo { color: #fff; }
.login-tagline { color: rgba(255, 255, 255, 0.75); }
.login-feats { color: rgba(255, 255, 255, 0.55); }
.login-feats li::before { color: #a5b4fc; }

/* ================= UI 打磨：甘特质感 ================= */
.gantt .row-alt { fill: rgba(16, 24, 40, 0.022); }
.gantt .weekend { fill: rgba(16, 24, 40, 0.045); }
.gantt .header-bg { fill: #fbfbfd; }
.gantt-bar .bar-shape { fill: #818cf8; }
.gantt-bar.done .bar-shape { fill: var(--ok); opacity: 0.9; }

/* ================= UI 打磨：结构图三形态（时间序，交付在底） ================= */
.struct-node.todo .struct-shape {
  fill: #fff;
  stroke: #a5b4fc;
  stroke-width: 1.2;
  stroke-dasharray: 3 2;
}
.struct-node.todo.t-supply .struct-shape { stroke: var(--supply); }
.struct-node.todo.t-milestone .struct-shape { stroke: #0284c7; }
.struct-node.active .struct-shape {
  fill: var(--accent);
  stroke: var(--accent);
  stroke-dasharray: none;
}
.struct-node.active .struct-ring {
  stroke: var(--accent);
  stroke-width: 1.5;
  animation: struct-pulse 1.6s var(--ease) infinite;
}
@keyframes struct-pulse {
  0% { opacity: 0.8; transform: scale(0.9); }
  70% { opacity: 0; transform: scale(1.25); }
  100% { opacity: 0; }
}
.struct-node { transform-box: fill-box; }
.struct-node .struct-ring { transform-origin: center; }
.struct-node.done .struct-shape {
  fill: var(--ok);
  stroke: var(--ok);
  stroke-dasharray: none;
  opacity: 1;
}
.struct-check {
  fill: none;
  stroke: #fff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.struct-node.done .struct-label { color: var(--ok); fill: var(--ok); }
.struct-node.crit .struct-shape { stroke: var(--crit); }
.struct-node.crit.done .struct-shape { stroke: var(--ok); }

.bf-list { list-style: none; margin: 0 0 12px; padding: 0; max-height: 200px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.bf-list li { display: flex; align-items: center; gap: 7px; }

/* ================= gantt 编辑交互 ================= */
.gantt-bar .bar-shape.draggable { cursor: grab; }
.gantt-bar .bar-shape.draggable:active { cursor: grabbing; }
.gantt-bar .bar-resize { fill: transparent; cursor: ew-resize; }
.gantt-bar .bar-connector {
  fill: #fff;
  stroke: var(--accent);
  stroke-width: 1.4;
  opacity: 0;
  cursor: crosshair;
  transition: opacity var(--t-fast) var(--ease);
}
.gantt-bar:hover .bar-connector { opacity: 1; }
.gantt .link-ghost {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  pointer-events: none;
}
.gantt-bar.link-target .bar-shape { stroke: var(--accent); stroke-width: 2.5; }
.gantt .drag-tip rect { fill: #18181b; opacity: 0.88; }
.gantt .drag-tip text { fill: #fff; font-size: 10px; }
.gantt .drag-tip { pointer-events: none; }

/* ================= gantt 右键菜单 ================= */
.wb-menu {
  position: fixed;
  z-index: 100;
  min-width: 168px;
  padding: 6px;
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
}
.wb-menu-head {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wb-menu button {
  border: none;
  background: none;
  text-align: left;
  padding: 6px 8px;
  font-size: 12.5px;
  font-family: var(--font);
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.wb-menu button:hover { background: var(--accent-soft); color: var(--accent-hover); }

/* ================= 变更记录 / 协同提示 ================= */
.wb-stalebar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  background: var(--accent-soft);
  border-bottom: 1px solid #c7d2fe;
  color: var(--accent-hover);
  font-size: 12.5px;
}
.ch-list { list-style: none; margin: 10px 0; padding: 0; max-height: 420px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px; }
.ch-item { display: flex; align-items: center; gap: 8px; padding: 6px 4px;
  border-bottom: 1px solid var(--border); font-size: 12.5px; }
.ch-item:last-child { border-bottom: none; }
.ch-time { flex: none; font-variant-numeric: tabular-nums; }
.ch-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-rb { flex: none; }

/* 聊天历史：用户名前缀 */
.chat-msg.user .chat-u-name {
  display: block;
  font-size: 10.5px;
  opacity: 0.7;
  margin-bottom: 2px;
}

/* ================= documents（文档库） ================= */
.docs-dialog { width: 92vw; max-width: 1180px; height: 88vh; padding: 0; display: flex; flex-direction: column; }
.docs-wrap { flex: 1; display: flex; min-height: 0; }
.docs-list { width: 240px; flex: none; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.docs-list-head { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border); }
.docs-list ul { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.doc-item { padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 2px; }
.doc-item:hover { background: var(--bg); }
.doc-item.on { background: var(--accent-soft); }
.doc-item-title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-item-meta { font-size: 11px; margin-top: 2px; }

.docs-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.docs-empty { margin: auto; }
.docs-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 72px 10px 14px;
  border-bottom: 1px solid var(--border); }
.docs-toolbar #doc-title { flex: 0 1 280px; font-size: 14px; font-weight: 600; }
.docs-tabs { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.docs-tabs button { border: none; background: var(--panel); padding: 4px 12px; font-size: 12px;
  color: var(--text-2); cursor: pointer; font-family: var(--font); }
.docs-tabs button.on { background: var(--accent); color: #fff; }
.docs-body { flex: 1; min-height: 0; display: flex; }
.docs-body textarea {
  flex: 1; border: none; border-radius: 0; resize: none; padding: 18px 22px;
  font-family: var(--mono); font-size: 13px; line-height: 1.65;
}
.docs-body textarea:focus { box-shadow: none; }
.doc-preview { flex: 1; overflow-y: auto; padding: 18px 26px; max-width: none;
  align-self: stretch; border-radius: 0; background: var(--panel); border: none; }
.docs-close { position: absolute; top: 10px; right: 14px; }

/* ================= admin skills ================= */
.ad-skill-warn {
  background: var(--warn-soft);
  border: 1px solid #fdba74;
  color: #9a3412;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  margin-bottom: 10px;
}
.ad-skill-load-warn { color: var(--crit); font-size: 12px; margin-bottom: 8px; }
.sk-edit { margin-top: 10px; padding: 12px; }
.sk-source {
  width: 100%; min-height: 200px; margin: 8px 0 4px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  white-space: pre; overflow-wrap: normal; overflow-x: auto;
}
.sk-hint { font-size: 11.5px; margin-bottom: 8px; }
.sk-validate { font-size: 12px; margin: 6px 0; font-family: var(--mono); white-space: pre-wrap; }
.sk-validate.ok { color: var(--ok); }
.sk-validate.err { color: var(--crit); }

/* ================= chat 交互强化：时间戳/分隔/操作 ================= */
.chat-sep { display: flex; align-items: center; text-align: center; margin: 8px 0;
  color: var(--text-3); font-size: 11px; }
.chat-sep::before, .chat-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.chat-sep span { padding: 0 10px; white-space: nowrap; }
.chat-sep-hist span { color: var(--accent); }
.chat-more { display: block; margin: 4px auto 8px; }

.chat-time { font-size: 10px; color: var(--text-3); margin-left: 6px; font-variant-numeric: tabular-nums; }
.chat-msg.user .chat-time { color: rgba(255, 255, 255, 0.6); }

.chat-actions {
  display: flex; align-items: center; gap: 8px; margin-top: 5px;
  opacity: 0; transition: opacity var(--t-fast) var(--ease);
}
.chat-msg.assistant:hover .chat-actions { opacity: 1; }
.chat-actions button {
  border: none; background: none; padding: 0; cursor: pointer;
  font-size: 11px; color: var(--text-3); font-family: var(--font);
}
.chat-actions button:hover { color: var(--accent); }
.chat-flash { font-size: 11px; color: var(--ok); }
