/* KONE EA 工程师工作台 — macOS 风格（毛玻璃 / 大圆角 / 交通灯 / 分段控件） */
:root {
  --mac-blue: #0071e3;         /* macOS 主操作蓝 */
  --mac-blue-soft: #e8f1fd;
  --kone-red: #e2001a;         /* KONE 品牌红：关键确认/危险 */
  --mac-green: #34c759;
  --mac-orange: #ff9500;
  --mac-red: #ff3b30;
  --bg: #f5f5f7;
  --panel: #ffffff;
  --hairline: rgba(0, 0, 0, 0.09);
  --text: #1d1d1f;
  --muted: #86868b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
  --focus-ring: 0 0 0 3.5px rgba(0, 113, 227, 0.25);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
#app { display: flex; flex-direction: column; height: 100vh; }

/* ===== 顶栏：毛玻璃工具栏 ===== */
.topbar {
  display: flex; align-items: center; gap: 14px;
  background: rgba(246, 246, 248, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
  padding: 9px 18px; flex-shrink: 0; z-index: 10;
}
.traffic { display: flex; gap: 7px; align-items: center; }
.traffic i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.traffic i:nth-child(1) { background: #ff5f57; box-shadow: inset 0 0 0 0.5px rgba(0,0,0,.1); }
.traffic i:nth-child(2) { background: #febc2e; }
.traffic i:nth-child(3) { background: #28c840; }
.topbar h1 { font-size: 13px; font-weight: 500; color: var(--muted); }
.topbar .logo { font-size: 15px; font-weight: 800; letter-spacing: 0.5px; white-space: nowrap; color: var(--text); }
.topbar .logo span { color: var(--kone-red); }
.badges { margin-left: auto; display: flex; gap: 6px; }
.badge {
  font-size: 11px; padding: 3px 10px; border-radius: 10px; white-space: nowrap;
  background: rgba(0, 0, 0, 0.05); color: var(--muted);
}
.badge.ok { background: #d8f3dc; color: #1e8e3e; }
.badge.err { background: #fde5e3; color: #c5221f; }
.userbox { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-left: 10px; }

/* ===== 三栏：Finder 式侧栏 ===== */
.layout { display: flex; flex: 1; min-height: 0; }
.sidebar {
  width: 264px; flex-shrink: 0;
  background: rgba(245, 245, 247, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--hairline);
  padding: 14px; overflow-y: auto; display: flex; flex-direction: column;
}
.main { flex: 1; overflow-y: auto; padding: 20px 22px; min-width: 0; }
.rightcol {
  width: 292px; flex-shrink: 0;
  background: rgba(250, 250, 252, 0.9);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-left: 1px solid var(--hairline);
  padding: 14px; overflow-y: auto;
}

/* ===== 侧栏 ===== */
.sidebar h3 {
  font-size: 11px; color: var(--muted); margin: 0 0 8px;
  letter-spacing: 0.8px; text-transform: uppercase; font-weight: 600;
}

/* 按钮（macOS push button） */
.btn {
  display: inline-block; border: none; border-radius: 8px; padding: 7px 15px;
  font-size: 13px; cursor: pointer; font-weight: 500;
  background: #fff; color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  transition: transform 0.06s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { background: #f7f7f9; }
.btn:active { transform: scale(0.98); }
.btn.accent { background: var(--kone-red); color: #fff; box-shadow: none; }
.btn.accent:hover { background: #cc0017; }
.btn.focus { background: var(--mac-blue); color: #fff; box-shadow: none; }
.btn.focus:hover { background: #0060c0; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.14); }
.btn.ghost.danger { color: #d92d20; box-shadow: inset 0 0 0 0.5px rgba(217, 45, 32, 0.35); }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn.lg { padding: 10px 20px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.full { width: 100%; text-align: center; }
.side-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }

/* 过滤器：分段控件 */
.filterbar { display: flex; gap: 2px; margin: 10px 0 10px; background: #e8e8ea; border-radius: 8px; padding: 2px; }
.chip {
  font-size: 12px; padding: 4px 0; border-radius: 6px; cursor: pointer;
  color: var(--muted); flex: 1; text-align: center; border: none;
}
.chip.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }

/* 任务列表项：白色圆角卡片 */
.task-item {
  padding: 10px 12px; border: 1px solid transparent; border-left-width: 4px;
  border-radius: 10px; margin-bottom: 7px; cursor: pointer;
  background: rgba(255, 255, 255, 0.85); box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, background 0.15s;
}
.task-item:hover { box-shadow: var(--shadow-md); }
.task-item.active { border-color: rgba(0, 113, 227, 0.35); background: #fff; box-shadow: var(--focus-ring); }
.task-item .t-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-item .t-meta { color: var(--muted); font-size: 11px; margin-top: 4px; display: flex; justify-content: space-between; gap: 6px; }
.st-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.st-dot.wait { background: var(--mac-red); box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.18); }
.st-dot.run { background: var(--mac-blue); animation: pulse 1.2s infinite; }
.st-dot.idle { background: #c7c7cc; }
.st-dot.done { background: var(--mac-green); }
.st-dot.paused { background: var(--mac-orange); }
.st-dot.err { background: #8e8e93; }
@keyframes pulse { 50% { opacity: 0.3; } }

/* ===== 任务页：标题行 ===== */
.task-top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.task-top h2 { font-size: 17px; font-weight: 700; }
.task-top .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.task-top .ops { display: flex; gap: 8px; align-items: center; }

/* ===== 步骤条 ===== */
.stepper {
  display: flex; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--hairline);
  border-radius: 14px; box-shadow: var(--shadow-sm);
  padding: 14px 10px 10px; margin-bottom: 16px; overflow-x: auto;
}
.sp-node { display: flex; flex-direction: column; align-items: center; min-width: 72px; position: relative; flex: 1; }
.sp-node::before {
  content: ""; position: absolute; top: 14px; left: -50%; width: 100%; height: 2px;
  background: rgba(0, 0, 0, 0.08); z-index: 0; border-radius: 1px;
}
.sp-node:first-child::before { display: none; }
.sp-node .dot {
  width: 29px; height: 29px; border-radius: 50%; background: #fff;
  border: 1.5px solid rgba(0, 0, 0, 0.12); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; z-index: 1; position: relative;
}
.sp-node.done .dot { background: var(--mac-green); border-color: var(--mac-green); color: #fff; }
.sp-node.done::before { background: var(--mac-green); }
.sp-node.current .dot {
  background: var(--mac-blue); border-color: var(--mac-blue); color: #fff;
  box-shadow: var(--focus-ring);
}
.sp-node.gate .dot { border-radius: 7px; transform: rotate(45deg); }

.sp-node.gate.wait .dot { background: var(--kone-red); border-color: var(--kone-red); color: #fff; animation: pulse 1.4s infinite; }
.sp-node.gate.done .dot { background: var(--mac-green); border-color: var(--mac-green); color: #fff; }
.sp-label { font-size: 11px; color: var(--muted); margin-top: 8px; text-align: center; white-space: nowrap; }
.sp-node.current .sp-label { color: var(--mac-blue); font-weight: 700; }
.sp-node.gate.wait .sp-label { color: var(--kone-red); font-weight: 700; }
.sp-node.done .sp-label { color: var(--mac-green); }

/* ===== 动作卡（唯一焦点） ===== */
.actioncard {
  border-radius: 14px; margin-bottom: 16px; overflow: hidden;
  background: var(--panel); box-shadow: var(--shadow-md);
  border-left: 6px solid var(--mac-blue);
}
.actioncard.ac { border-left-color: var(--kone-red); }
.actioncard.warn { border-left-color: var(--mac-orange); }
.actioncard.err { border-left-color: var(--mac-red); }
.actioncard.ok { border-left-color: var(--mac-green); }
.ac-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
/* SVG 图标瓦片（动作卡头部，macOS 设置风格彩色圆角方块） */
.ac-icon {
  width: 30px; height: 30px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; background: #eaf3fc; color: var(--mac-blue);
}
.actioncard.ok .ac-icon { background: #e4f7e8; color: var(--mac-green); }
.actioncard.warn .ac-icon { background: #fff2e0; color: var(--mac-orange); }
.actioncard.err .ac-icon { background: #fde8e6; color: var(--mac-red); }
.ac-icon .ic { display: block; }

/* 按钮内 SVG 图标 */
.btn .ic { width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px; }
.btn.sm .ic { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; }
.btn.lg .ic { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; }
.sp-node .dot .ic { display: block; margin: 0; }
.ac-head h2 { font-size: 16px; font-weight: 700; }
.ac-head .hint { color: var(--muted); font-size: 12px; margin-top: 3px; }
.ac-body { padding: 12px 20px; font-size: 13px; line-height: 1.7; }
.ac-body .lead { font-size: 14px; margin-bottom: 8px; }
.ac-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 0 20px 18px; }
.ac-actions .spacer { flex: 1; }
.ac-reason { margin: 10px 20px; }
.ac-reason textarea, textarea {
  width: 100%; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 8px; padding: 8px 11px;
  font-size: 13px; font-family: inherit; background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}
textarea:focus, input:focus, select:focus { outline: none; box-shadow: var(--focus-ring); }
.ac-stats { display: flex; gap: 20px; flex-wrap: wrap; padding: 4px 0 8px; }
.ac-stats .stat { font-size: 12px; color: var(--muted); }
.ac-stats .stat b { font-size: 15px; color: var(--text); margin-right: 4px; }

/* 方向/候选选择卡 */
.choice-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.choice {
  border: 1px solid var(--hairline); border-radius: 12px; padding: 12px 14px; cursor: pointer;
  background: #fff; min-width: 200px; flex: 1; max-width: 340px;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.15s, transform 0.1s;
}
.choice:hover { box-shadow: var(--shadow-md); }
.choice.rec { border-color: rgba(0, 113, 227, 0.45); background: var(--mac-blue-soft); }
.choice .c-title { font-weight: 700; font-size: 13px; }
.choice .c-title .badge-rec {
  font-size: 10px; background: var(--mac-blue); color: #fff; border-radius: 8px; padding: 1px 7px; margin-left: 6px;
}
.choice .c-desc { color: var(--muted); font-size: 12px; margin: 5px 0; line-height: 1.5; }
.choice .c-meta { font-size: 11px; color: #3c6db8; }
.choice .c-ops { margin-top: 8px; }

/* ===== 标签页：分段控件 ===== */
.tabs {
  display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 14px;
  background: #e8e8ea; border-radius: 10px; padding: 3px; width: fit-content;
}
.tab {
  font-size: 13px; padding: 5px 14px; cursor: pointer; color: var(--muted);
  border-radius: 7px; display: flex; gap: 6px; align-items: center;
  transition: color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); }
.tab .cnt { font-size: 10px; background: rgba(0, 0, 0, 0.07); color: var(--muted); border-radius: 8px; padding: 1px 6px; }

.panel {
  background: var(--panel); border: 1px solid var(--hairline); border-radius: 14px;
  box-shadow: var(--shadow-sm); padding: 18px; margin-bottom: 14px;
}
.panel h2 { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.panel h2 .tag { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 8px; }
.panel h3 { font-size: 13px; margin: 14px 0 6px; color: var(--text); font-weight: 600; }

/* ===== 表格 ===== */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; border-radius: 10px; overflow: hidden; }
th, td { padding: 8px 10px; text-align: left; vertical-align: top; }
th {
  background: rgba(0, 0, 0, 0.035); font-size: 11.5px; color: var(--muted);
  font-weight: 600; white-space: nowrap;
}
td { border-bottom: 1px solid rgba(0, 0, 0, 0.05); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(0, 113, 227, 0.03); }
.num { text-variant-numeric: tabular-nums; }

/* 三态徽标：macOS 色系 */
.st { font-size: 11px; padding: 2px 9px; border-radius: 10px; white-space: nowrap; display: inline-block; font-weight: 500; }
.st.pass { background: #d8f3dc; color: #1e8e3e; }
.st.fail { background: #fde5e3; color: #c5221f; }
.st.undet { background: #fdeed6; color: #a05e0c; }
.st.warn { background: #fdeed6; color: #a05e0c; }
.st.info { background: rgba(0, 0, 0, 0.05); color: var(--muted); }
.st.sim { background: #ece4f7; color: #6b3fa0; }

/* ===== 其他通用 ===== */
.muted { color: var(--muted); font-size: 12px; }
.kv { font-size: 12px; margin: 3px 0; }
.kv b { color: var(--text); }
.note-box {
  background: #fff8e6; border: 1px solid rgba(160, 94, 12, 0.18); border-radius: 10px;
  padding: 10px 13px; font-size: 12px; margin: 10px 0; line-height: 1.6;
}
.note-box.good { background: #eaf7ec; border-color: rgba(30, 142, 62, 0.22); }
.note-box.bad { background: #fdeceb; border-color: rgba(197, 34, 31, 0.2); }
.note-box.info { background: var(--mac-blue-soft); border-color: rgba(0, 113, 227, 0.18); }
.sim-note {
  background: #f3eefb; border: 1px solid rgba(107, 63, 160, 0.2); color: #5a3488;
  border-radius: 10px; padding: 8px 13px; font-size: 12px; margin: 10px 0;
}
.spinner {
  display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(0, 113, 227, 0.25);
  border-top-color: var(--mac-blue); border-radius: 50%;
  animation: spin 0.8s linear infinite; vertical-align: -3px; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }
pre.xml {
  background: #f6f6f8; border: 1px solid var(--hairline); border-radius: 10px;
  padding: 10px; font-size: 11px; overflow-x: auto; max-height: 220px; white-space: pre;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.drawing-box { border: 1px solid var(--hairline); border-radius: 12px; padding: 12px; background: #fff; overflow-x: auto; }
.empty { color: var(--muted); text-align: center; padding: 90px 0; font-size: 15px; }
.empty .sub { font-size: 12px; margin-top: 8px; }
.collapsible summary { cursor: pointer; font-size: 12px; color: var(--muted); padding: 6px 0; }

/* ===== 登录：macOS 桌面渐变 + 毛玻璃卡片 ===== */
.login-overlay {
  position: fixed; inset: 0; z-index: 100;
  background:
    radial-gradient(1200px 700px at 15% 20%, #b8d8f2 0%, transparent 55%),
    radial-gradient(1000px 800px at 85% 30%, #f6c9d8 0%, transparent 50%),
    radial-gradient(900px 700px at 60% 95%, #cfe3d1 0%, transparent 55%),
    linear-gradient(180deg, #e8ecf2 0%, #dde3ec 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-box {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 18px; padding: 30px 34px; width: 360px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}
.login-box h2 { font-size: 17px; font-weight: 700; }
.login-box label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.login-box input {
  border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 9px; padding: 9px 12px; font-size: 14px;
  background: rgba(255, 255, 255, 0.85);
}
.login-error { color: #c5221f; font-size: 12px; min-height: 16px; }
.logo.big { font-size: 22px; font-weight: 800; color: var(--text); }
.logo.big span { color: var(--kone-red); }

/* ===== 向导弹窗：macOS sheet ===== */
.modal-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 48px 0;
}
.modal {
  background: rgba(250, 250, 252, 0.96);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-radius: 16px; border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 24px 28px; width: 620px; max-width: 94vw;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.28);
}
.modal h2 { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.modal .modal-sub { color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.wiz-steps { display: flex; gap: 6px; margin-bottom: 18px; }
.wiz-step {
  flex: 1; text-align: center; font-size: 12px; padding: 7px 0; border-radius: 8px;
  background: rgba(0, 0, 0, 0.05); color: var(--muted);
}
.wiz-step.cur { background: var(--mac-blue); color: #fff; font-weight: 600; }
.wiz-step.done { background: #d8f3dc; color: #1e8e3e; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form-grid input, .form-grid select, .modal input[type=file] {
  border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 8px; padding: 8px 11px; font-size: 13px;
  background: rgba(255, 255, 255, 0.9);
}
.nonstd-row { display: flex; gap: 6px; margin-bottom: 8px; align-items: center; }
.nonstd-row select { flex: 0 0 190px; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 8px; padding: 8px 10px; font-size: 13px; background: rgba(255,255,255,.9); }
.nonstd-row input { flex: 1; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.nonstd-row input.note { flex: 1.4; }
.filebox {
  border: 1.5px dashed rgba(0, 0, 0, 0.18); border-radius: 12px; padding: 24px;
  text-align: center; cursor: pointer; color: var(--muted); font-size: 13px;
  transition: border-color 0.15s, background 0.15s;
}
.filebox:hover { border-color: var(--mac-blue); background: var(--mac-blue-soft); }
.filebox.has { border-color: var(--mac-green); border-style: solid; background: #eaf7ec; color: #1e8e3e; font-weight: 600; }
.modal .actions { display: flex; gap: 10px; margin-top: 18px; justify-content: space-between; }
.modal .actions .right { display: flex; gap: 10px; }

/* ===== 知识库条目（功能未重构，仅随主题换肤） ===== */
.kb-item { border: 1px solid var(--hairline); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.kb-item summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.kb-json {
  width: 100%; margin-top: 8px; font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 11px;
  border: 1px solid var(--hairline); border-radius: 8px; padding: 8px; min-height: 120px;
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

/* ===== 右栏时间线 ===== */
.rightcol h3 {
  font-size: 11px; color: var(--muted); margin-bottom: 10px;
  letter-spacing: 0.8px; text-transform: uppercase; font-weight: 600;
}
.timeline { font-size: 11.5px; }
.tl-item { padding: 6px 0 6px 12px; border-left: 2px solid rgba(0, 0, 0, 0.08); position: relative; margin-left: 5px; }
.tl-item::before {
  content: ""; position: absolute; left: -5px; top: 10px; width: 8px; height: 8px;
  border-radius: 50%; background: #aeaeb2;
}
.tl-item.a0::before { background: var(--kone-red); }
.tl-item.gate::before { background: var(--mac-blue); }
.tl-item .ts { color: var(--muted); font-size: 10px; }
.tl-item .agent { font-weight: 600; margin-right: 4px; }

/* 滚动条：macOS 细样式 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.18); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.28); }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 知识建设工作台（maintainer · kb.js） ============ */
/* 三支柱标签（业务规则/记忆/资料），沿用既有色板 */
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px;
  border-radius: 10px; background: rgba(0, 0, 0, 0.05); color: var(--muted);
  white-space: nowrap; }
.pill + b { margin-left: 6px; }
/* 知识条目卡（草稿编辑器与详情只读视图共用），左边框按支柱分色 */
.itemcard { background: #fff; border: 0.5px solid var(--hairline); border-left: 3px solid var(--mac-blue);
  border-radius: 10px; padding: 12px 14px; margin: 10px 0; box-shadow: var(--shadow-sm); }
.itemcard.pillar-rule { border-left-color: var(--kone-red); }
.itemcard.pillar-memory { border-left-color: var(--mac-orange, #ff9500); }
.itemcard.pillar-material { border-left-color: var(--mac-green); }
.itemcard .ic-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.itemcard .ic-head b { font-size: 13px; }
.itemcard .ic-head .spacer { flex: 1; }
.itemcard .ic-body { font-size: 13px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.itemcard select, .itemcard input, .itemcard textarea {
  width: 100%; font: inherit; padding: 6px 10px; border: 0.5px solid var(--hairline);
  border-radius: 7px; background: #fff; margin-top: 4px; }
.itemcard textarea { font-family: ui-monospace, SF Mono, Menlo, monospace; font-size: 12px;
  line-height: 1.55; resize: vertical; }
.itemcard .form-grid { margin-bottom: 0; }
/* 待整理区勾选列表 */
.intake-checks { border: 0.5px solid var(--hairline); border-radius: 10px;
  padding: 8px 12px; margin-top: 8px; background: var(--paper, #f6f6f8); }
.intake-checks .kv.ck { display: flex; gap: 6px; align-items: baseline; cursor: pointer; }
/* K 步骤条内的阶段编码角标 */
.sp-label .kcode { display: block; font-size: 10px; color: var(--muted); opacity: 0.75; }
.sp-node.current .sp-label .kcode { color: var(--mac-blue); }
/* maintainer 任务视图只读：隐藏全部操作按钮与删除入口，保留浏览 */
body.role-maintainer #main[data-view="task"] .ac-actions,
body.role-maintainer #main[data-view="task"] .ac-reason .actions,
body.role-maintainer #main[data-view="task"] .task-top .ops .danger { display: none; }
body.role-maintainer #main[data-view="task"]::before {
  content: "只读视图：知识维护人不参与任务操作，仅查看设计过程与归档事实";
  display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
/* 知识侧栏（列表与过滤 chips 复用既有 .filterbar/.task-item） */
#kb-side { flex-direction: column; gap: 8px; }
#kb-side .filterbar { margin: 0; }
#kb-intake-info .btn.full { width: 100%; justify-content: center; }
/* 新建知识包弹窗：三支柱入口 + 对话起草 */
.kb-pillar-row { display: flex; gap: 6px; margin-top: 2px; }
.kb-pillar-row .chip { cursor: pointer; }
.modal textarea { font: inherit; padding: 8px 10px; border: 0.5px solid var(--hairline);
  border-radius: 8px; background: #fff; resize: vertical; line-height: 1.55; }
/* 起草附件（建包视图与包页共用的附件小签） */
.att-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.att-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px;
  padding: 3px 9px; border: 0.5px solid var(--hairline); border-radius: 9px;
  background: #fff; white-space: nowrap; }
.att-chip .muted { font-size: 10.5px; }
/* 建包过程消息（终端同款时间线：成功=绿点） */
.tl-item.oklog::before { background: var(--mac-green); }

/* ============ 知识任务对话（终端同构：任务=知识包，全程消息） ============ */
/* 新建任务作曲器（HomeView） */
.kb-home { max-width: 760px; margin: 28px auto 0; }
.kb-home-hero h2 { margin-bottom: 4px; }
.kb-home-hero .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 16px; }
.kb-composer { border: 0.5px solid var(--hairline); border-radius: 12px;
  background: #fff; padding: 14px 16px; box-shadow: var(--shadow-md); }
.kb-composer textarea { width: 100%; font: inherit; padding: 10px 12px;
  border: 0.5px solid var(--hairline); border-radius: 9px; background: #fff;
  resize: vertical; line-height: 1.6; margin-top: 8px; }
.kb-composer input[type="file"] { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.kb-composer .actions { margin-top: 10px; }
/* 任务标题条 */
.task-top#kb-task-top { display: flex; justify-content: space-between;
  align-items: flex-start; gap: 12px; margin-bottom: 2px; }
/* 消息线程 */
.kb-thread { display: flex; flex-direction: column; gap: 14px; padding: 14px 2px 18px;
  overflow-y: auto; flex: 1; min-height: 200px; }
.kb-thread-empty { color: var(--muted); font-size: 12.5px; text-align: center;
  padding: 40px 0; }
.kb-msg { display: flex; }
.kb-msg.user { justify-content: flex-end; }
.kb-msg.assistant { justify-content: flex-start; }
.kb-bubble { max-width: 86%; border-radius: 12px; padding: 10px 14px;
  font-size: 13px; line-height: 1.6; }
.kb-bubble.user { background: var(--mac-blue); color: #fff;
  border-bottom-right-radius: 4px; }
.kb-bubble.user .kb-msg-head { color: rgba(255,255,255,0.75); }
.kb-bubble.user .att-chip { background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.3); color: #fff; }
.kb-bubble.user .att-chip .muted { color: rgba(255,255,255,0.7); }
.kb-bubble.assistant { background: #fff; border: 0.5px solid var(--hairline);
  border-bottom-left-radius: 4px; box-shadow: var(--shadow-md); }
.kb-bubble.kb-bubble-err { border-color: var(--mac-red, #e0453e); }
.kb-msg-head { font-size: 11px; color: var(--muted); display: flex;
  align-items: center; gap: 5px; margin-bottom: 6px; }
.kb-msg-body { white-space: pre-wrap; word-break: break-word; }
/* 过程快照（起草条目/核验报告/发布明细）折叠块 */
.kb-snapshot { margin-top: 8px; border-top: 0.5px solid var(--hairline);
  padding-top: 8px; }
.kb-snapshot summary { font-size: 11.5px; color: var(--muted); cursor: pointer;
  user-select: none; }
.kb-snapshot .itemcard { margin-top: 8px; }
.kb-snapshot .note-box { margin-top: 6px; }
.kb-snapshot .tw { margin-top: 8px; }
/* 底部区：草稿条目整理 + 追加输入 */
.kb-bottom { border-top: 0.5px solid var(--hairline); padding-top: 10px; }
.kb-editor summary { font-size: 12.5px; cursor: pointer; color: var(--muted);
  user-select: none; }
.kb-inputbar { margin-top: 10px; border: 0.5px solid var(--hairline);
  border-radius: 12px; background: #fff; padding: 10px 12px;
  box-shadow: var(--shadow-md); }
.kb-inputbar textarea { width: 100%; font: inherit; padding: 8px 10px;
  border: 0.5px solid var(--hairline); border-radius: 9px; background: #fff;
  resize: vertical; line-height: 1.55; }
.kb-inputbar-row { display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-top: 8px; }
.kb-inputbar-row input[type="file"] { font-size: 11px; color: var(--muted); }
.kb-inputbar-row .att-list { margin: 0; flex: 1; }
.kb-inputbar-row .spacer { flex: 1; }
/* 单焦点动作区（核验中/待审核/驳回/已发布） */
.kb-actions { border-top: 0.5px solid var(--hairline); padding: 14px 2px 6px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.kb-reject { flex: 1 1 320px; }
.kb-reject textarea { width: 100%; font: inherit; padding: 6px 10px;
  border: 0.5px solid var(--hairline); border-radius: 8px; resize: vertical; }
/* 附件选择：+ 图标按钮 + 隐藏原生 input（终端同款） */
.kb-file-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.kb-file-row .att-list { margin: 0; flex: 1; }
