/* PAOS Web — 浅色专业后台主题（零构建 / 零外部依赖） */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --border: #e3e8ef;
  --border-strong: #cfd8e3;
  --text: #1f2937;
  --text-2: #4b5563;
  --muted: #8a94a6;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-soft-2: #dbeafe;
  --success: #16a34a;
  --success-soft: #eafaf0;
  --warn: #d97706;
  --warn-soft: #fff7e6;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --info: #0891b2;
  --info-soft: #ecfeff;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 14px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .16);
  --radius: 10px;
  --radius-sm: 6px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
pre, code { font-family: var(--mono); }
::selection { background: var(--primary-soft-2); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(16,24,40,.03);
}
.topbar-inner {
  max-width: 1560px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px;
  padding: 0 20px; height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff; font-weight: 800; font-size: 18px;
  display: grid; place-items: center; box-shadow: 0 3px 10px rgba(37,99,235,.28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; letter-spacing: .5px; }
.brand-text small { font-size: 10px; color: var(--muted); }
.nav {
  display: flex; align-items: center; gap: 2px;
  flex: 1 1 auto; overflow-x: auto; height: 100%;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.nav::-webkit-scrollbar { height: 4px; }
.nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.nav-item {
  position: relative; display: flex; align-items: center;
  height: 100%; padding: 0 12px; flex: 0 0 auto;
  color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap;
  border-bottom: 2px solid transparent; transition: .15s;
}
.nav-item:hover { color: var(--primary); background: var(--surface-2); }
.nav-item.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.topbar-right { flex: 0 0 auto; }
.health {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted); padding: 6px 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
}
.health .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.health.ok .dot { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.health.bad .dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* ---------- Layout ---------- */
.view { max-width: 1560px; margin: 0 auto; padding: 22px 20px 60px; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-head h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: .2px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.page-head .head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.mt { margin-top: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.right { text-align: right; }

/* ---------- Card / Panel ---------- */
.card, .panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card { padding: 16px; }
.panel { overflow: hidden; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.panel-head h2, .panel-head h3 { margin: 0; font-size: 14px; font-weight: 650; }
.panel-body { padding: 16px; }
.stat-card { padding: 16px 18px; }
.stat-card .stat-label { color: var(--muted); font-size: 12px; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; margin-top: 4px; line-height: 1.2; }
.stat-card .stat-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; border-color: #15803d; color: #fff; }
.btn-danger { background: var(--surface); border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-lg { padding: 10px 18px; font-size: 14px; }
.btn-icon { padding: 6px 9px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-3); }

/* ---------- Form controls ---------- */
input[type="text"], input[type="number"], input[type="password"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; min-height: 76px; line-height: 1.6; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); }
label.field > span { font-weight: 600; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.checkline { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.checkline input { width: 16px; height: 16px; accent-color: var(--primary); }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px;
  transition: .2s; cursor: pointer;
}
.switch .slider::before {
  content: ""; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(17px); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge-a, .badge-success, .badge-done { background: var(--success-soft); color: var(--success); }
.badge-b, .badge-warn, .badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-c, .badge-danger, .badge-blocked { background: var(--danger-soft); color: var(--danger); }
.badge-info, .badge-running { background: var(--info-soft); color: var(--info); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--muted); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; padding: 10px 12px; background: var(--surface-2);
  color: var(--text-2); font-weight: 600; font-size: 12px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .cell-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tbl .content-cell { max-width: 420px; word-break: break-word; }

/* ---------- Empty / Loading ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 42px 16px; text-align: center; color: var(--muted);
}
.empty .empty-icon { font-size: 28px; opacity: .5; }
.empty strong { color: var(--text-2); font-size: 14px; }
.empty p { margin: 0; font-size: 12.5px; max-width: 340px; }
.loading { padding: 36px; text-align: center; color: var(--muted); font-size: 13px; }
.spinner {
  display: inline-block; width: 14px; height: 14px; border: 2px solid var(--primary-soft-2);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: -2px; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 72px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); font-size: 13px; animation: slidein .2s ease-out;
}
.toast::before { content: ""; width: 4px; align-self: stretch; border-radius: 2px; background: var(--info); flex: 0 0 auto; }
.toast.ok::before { background: var(--success); }
.toast.err::before { background: var(--danger); }
.toast.warn::before { background: var(--warn); }
@keyframes slidein { from { opacity: 0; transform: translateX(18px); } }

/* ---------- Modal ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 150; background: rgba(15, 23, 42, .38);
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 24px;
  overflow-y: auto;
}
.modal {
  width: 100%; max-width: 620px; background: var(--surface);
  border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden;
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.99); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }
.modal-close { border: none; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; padding: 0 4px; }
.modal-close:hover { color: var(--danger); }

/* ---------- JSON box ---------- */
.json-box {
  margin: 0; padding: 12px 14px; max-height: 320px; overflow: auto;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 12px; line-height: 1.55;
  color: var(--text-2); white-space: pre-wrap; word-break: break-word;
}
details.json-details { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
details.json-details > summary { cursor: pointer; padding: 7px 10px; font-size: 12px; color: var(--primary); font-weight: 600; }
details.json-details > .json-box { border: none; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }

/* ---------- Chat ---------- */
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; align-items: start; }
.chat-panel { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 460px; }
.chat-msgs { flex: 1 1 auto; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; max-width: 86%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #64748b, #475569);
}
.msg.user .avatar { background: linear-gradient(135deg, var(--primary), #4f46e5); }
.bubble {
  padding: 10px 13px; border-radius: 10px 10px 10px 2px;
  background: var(--surface-2); border: 1px solid var(--border); white-space: pre-wrap; word-break: break-word;
}
.msg.user .bubble { background: var(--primary); border-color: var(--primary); color: #fff; border-radius: 10px 10px 2px 10px; }
/* 对话内直接渲染真实成果：标题/表格/清单/可点击文件 */
.bubble.md-body { white-space: normal; line-height: 1.6; }
.md-h { font-weight: 700; color: var(--text); margin: 9px 0 5px; }
.md-h2 { font-size: 14px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.md-h3 { font-size: 13px; }
.md-h4 { font-size: 12px; }
.md-p { margin: 2px 0; }
.md-li { margin: 2px 0 2px 14px; position: relative; }
.md-li::before { content: '•'; position: absolute; left: -12px; color: var(--primary); }
.md-table { width: 100%; border-collapse: collapse; margin: 7px 0; font-size: 12px; }
.md-table th, .md-table td { border: 1px solid var(--border); padding: 5px 8px; text-align: left; }
.md-table th { background: var(--surface-2); font-weight: 700; }
.md-body a { color: var(--primary); text-decoration: none; border-bottom: 1px dashed var(--primary); }
.md-body a:hover { background: var(--primary-soft); }
.msg .meta { font-size: 11px; color: var(--muted); margin-top: 5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.msg .options { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.msg .options .btn { background: var(--surface); }
.deliverables { margin-top: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 8px 10px; max-width: 520px; }
.deliverables .dv-title { font-size: 11px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.dv-item { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 6px; font-size: 12px; color: var(--text); text-decoration: none; border-bottom: 1px dashed var(--border); }
.dv-item:last-child { border-bottom: 0; }
a.dv-item:hover { background: var(--surface-2); }
.dv-ico { flex: 0 0 auto; }
.dv-open { margin-left: auto; color: var(--primary); font-size: 11px; flex: 0 0 auto; }
.dv-fact { color: var(--muted); word-break: break-word; }
/* ---------- 对话输入区（重做：分层布局 + 自动增高 + 语义化工具条） ---------- */
.chat-compose { border-top: 1px solid var(--border); padding: 12px 16px 10px; background: var(--surface-2); }
.compose-input textarea {
  width: 100%; min-height: 78px; max-height: 168px; resize: none;
  background: var(--surface); line-height: 1.6; padding: 10px 12px; overflow-y: auto;
}
.compose-input textarea:focus { box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
/* 工具条：左侧快捷指令、右侧操作，两行自适应不再挤成一排 */
.compose-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 9px; }
.compose-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.compose-quick .cq-label { font-size: 11px; color: var(--muted); margin-right: 2px; white-space: nowrap; }
.cq-btn { font-size: 11.5px; padding: 3px 9px; border-radius: 12px; border: 1px solid var(--primary-soft-2);
  background: var(--primary-soft); color: var(--primary); cursor: pointer; white-space: nowrap; }
.cq-btn:hover { background: var(--primary-soft-2); }
.compose-actions { display: flex; align-items: center; gap: 6px; }
/* 开关类按钮：关=灰、开=主色高亮，一眼可辨 */
.tool-btn { font-size: 11.5px; padding: 5px 10px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer; white-space: nowrap; transition: all .15s; }
.tool-btn:hover { border-color: var(--primary-soft-2); color: var(--primary); }
.tool-btn.on { background: var(--primary-soft); border-color: var(--primary-soft-2); color: var(--primary); font-weight: 600; }
.tool-btn.voice { font-weight: 600; }
/* 语音录入中：红色脉冲提示"正在听" */
.tool-btn.recording { background: #fee2e2; border-color: #f87171; color: #b91c1c; animation: voicePulse 1.2s ease-in-out infinite; }
@keyframes voicePulse { 0%, 100% { opacity: 1; } 50% { opacity: .58; } }
.compose-input textarea.voice-listening { border-color: #f87171; box-shadow: 0 0 0 3px rgba(248,113,113,.16); }
.compose-hint { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; font-size: 10.5px; color: var(--muted); }
.compose-hint #chat-count { white-space: nowrap; }
/* 澄清选项与输入框拉开距离，加引导语避免混淆为输入区按钮 */
.msg .options { border-top: 1px dashed var(--border); padding-top: 8px; margin-top: 10px; }
.msg .options::before { content: '选择一项或直接继续输入'; display: block; width: 100%; font-size: 10.5px; color: var(--muted); margin-bottom: 2px; }
.chat-side .panel-body { font-size: 12.5px; }
.chat-side .side-row { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.chat-side .side-row:last-child { border-bottom: none; }

/* ---------- Board ---------- */
.board-cols { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.board-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); min-height: 200px; }
.board-col-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; border-bottom: 1px solid var(--border); font-weight: 650; font-size: 13px; }
.board-col-head .count { background: var(--surface-3); color: var(--text-2); border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.board-col-body { padding: 10px; display: flex; flex-direction: column; gap: 9px; }
.task-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 11px; box-shadow: var(--shadow); }
.task-card:hover { border-color: var(--border-strong); }
.task-card h4 { margin: 0 0 7px; font-size: 13px; line-height: 1.45; }
.task-card .tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }
.task-card .t-meta { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.task-card .t-actions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--border); }

/* ---------- Knowledge ---------- */
.kb-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.tree { padding: 8px; }
.tree-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 9px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; }
.tree-item:hover { background: var(--surface-3); }
.tree-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.tree-item .cnt { font-size: 11px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 16px; background: var(--surface); }
.tab { padding: 10px 13px; cursor: pointer; color: var(--text-2); font-size: 13px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.search-line { display: flex; gap: 8px; }
.search-line input { flex: 1; }
.hit { padding: 11px 0; border-bottom: 1px solid var(--border); }
.hit:last-child { border-bottom: none; }
.hit .hit-title { font-weight: 600; font-size: 13px; }
.hit .hit-snippet { color: var(--text-2); font-size: 12.5px; margin-top: 4px; }
.hit .hit-meta { color: var(--muted); font-size: 11px; margin-top: 5px; }

/* ---------- Tools ---------- */
.tool-card { display: flex; flex-direction: column; gap: 9px; }
.tool-card h3 { margin: 0; font-size: 14px; }
.tool-card .desc { color: var(--text-2); font-size: 12.5px; min-height: 38px; }
.tool-card .tool-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px dashed var(--border); padding-top: 9px; }
.tool-card .toggle-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }

/* ---------- Goals ---------- */
.goal-card h3 { margin: 0 0 6px; font-size: 14px; }
.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #60a5fa); border-radius: 999px; }
.goal-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 8px; }

/* ---------- Advanced ---------- */
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 9px; }
.action-card { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: .15s; }
.action-card:hover { border-color: var(--primary); background: var(--primary-soft); }
.action-card.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary-soft-2); }
.action-card .code { font-family: var(--mono); font-size: 11px; color: var(--primary); font-weight: 700; }
.action-card .name { font-size: 12.5px; margin-top: 2px; }
.param-hint { font-size: 11.5px; color: var(--muted); margin: 6px 0; }

/* ---------- Features ---------- */
.feat-summary { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.feat-group { margin-bottom: 20px; }
.feat-group h2 { font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.feat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.feat-item { display: flex; gap: 10px; padding: 11px 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.feat-item.ok { border-left: 3px solid var(--success); }
.feat-item.no { border-left: 3px solid var(--border-strong); opacity: .78; }
.feat-item .fcode { font-family: var(--mono); font-size: 11px; color: var(--primary); font-weight: 700; min-width: 38px; }
.feat-item .fbody { flex: 1; min-width: 0; }
.feat-item .ftitle { font-size: 13px; font-weight: 600; }
.feat-item .fnote { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-layout { grid-template-columns: minmax(0, 1fr) 240px; }
}
@media (max-width: 900px) {
  .topbar-inner { gap: 10px; padding: 0 12px; height: auto; flex-wrap: wrap; padding-top: 8px; }
  .nav { order: 3; width: 100%; height: 44px; }
  .topbar-right { margin-left: auto; }
  .view { padding: 16px 12px 50px; }
  .grid-2, .grid-3, .grid-4, .form-grid, .kb-layout { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-panel { height: 70vh; }
  .board-cols { grid-template-columns: repeat(4, 260px); }
}
@media (max-width: 560px) {
  .brand-text small { display: none; }
  .health span:not(.dot) { display: none; }
  .page-head h1 { font-size: 18px; }
}


/* ===== T-14 事件中心 ===== */
.ev-card { cursor: default; }
.ev-decision { border: 1px solid var(--border); border-radius: var(--border-radius-md); padding: 12px 14px; background: var(--surface-2); }
.ev-options { display: flex; gap: 6px; flex-wrap: wrap; }
.ev-phases { display: flex; flex-direction: column; gap: 8px; }
.ev-phase { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.ev-phase:last-child { border-bottom: none; }
.ev-phase .badge { flex: 0 0 auto; min-width: 66px; text-align: center; }

/* ---------- 多模型档案（T-35） ---------- */
.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 12px; }
.mp-card { border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; background: var(--surface); }
.mp-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.mp-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.mp-card-meta { font-size: 11px; color: var(--muted); word-break: break-all; line-height: 1.5; }
.mp-card-actions { display: flex; gap: 6px; margin-top: 8px; }
.mp-add { border-top: 1px dashed var(--border); padding-top: 10px; }
.mp-add summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: 13px; }

/* ---------- T-41 角色权限界面 ---------- */
.role-badge { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:14px; background:var(--surface-2); border:1px solid var(--border); font-size:12px; color:var(--text); margin-right:12px; }
.role-badge .dot { width:7px; height:7px; border-radius:50%; background:var(--primary); display:inline-block; }
.modal-error { margin-top:12px; padding:9px 12px; border-radius:7px; background:#fef2f2; border:1px solid #fecaca; color:#b91c1c; font-size:13px; line-height:1.5; }

/* ---------- T-49 云端部署 ---------- */
.cd-notice { background:#eff6ff; border:1px solid #bfdbfe; color:#1e40af; border-radius:8px; padding:9px 12px; margin-bottom:12px; font-size:12px; line-height:1.6; }
.cd-ops { white-space:nowrap; }
.cd-ops .btn { margin:2px; }
.cd-out { background:var(--surface-2); border:1px solid var(--border); border-radius:8px; padding:10px 12px; min-height:44px; color:var(--muted); font-size:12px; }
.cd-out-title { font-weight:700; color:var(--text); margin-bottom:8px; }
.cd-out pre { margin:0; white-space:pre-wrap; word-break:break-word; font-family:ui-monospace,Consolas,monospace; line-height:1.6; color:var(--text); }

/* ---------- 云端部署卡片式布局（T-52） ---------- */
.cd-actions4{display:flex;flex-wrap:wrap;gap:10px}.cd-actions4 .btn{flex:1 1 auto;min-width:140px;justify-content:center}
.cd-upload{padding:12px 14px;border:1px dashed var(--border);border-radius:8px;background:var(--surface-2)}
.cd-nodes{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:14px}
.cd-node{border:1px solid var(--border);border-radius:10px;padding:14px;background:var(--surface);display:flex;flex-direction:column;gap:10px}
.cd-node-head{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.cd-node-icon{font-size:24px;line-height:1}
.cd-node-meta{font-size:12px;color:var(--muted);line-height:1.75}.cd-node-meta b{color:var(--text)}
.cd-node-ops{display:flex;flex-wrap:wrap;gap:6px;margin-top:auto}
.head-between{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
