/* 策划参谋部 P0 —— 深色侧栏 + 浅色主区,系统字体 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #00a870;
  --brand-dark: #00875c;
  --side: #1e2430;
  --side-2: #273040;
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e4e7ec;
  --txt: #24292f;
  --txt-2: #6b7280;
}
html, body { height: 100%; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--txt); background: var(--bg); font-size: 14px;
}
.hidden { display: none !important; }
button { cursor: pointer; font-family: inherit; }
input, textarea {
  font-family: inherit; font-size: 14px; border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; outline: none; background: #fff; color: var(--txt);
}
input:focus, textarea:focus { border-color: var(--brand); }
.btn-primary {
  background: var(--brand); color: #fff; border: none; border-radius: 6px;
  padding: 8px 18px; font-size: 14px;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { background: #a5d6c2; cursor: not-allowed; }
.btn-ghost {
  background: #fff; color: var(--txt-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 18px;
}
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; padding: 10px; }

/* ---------- 登录页 ---------- */
.login-wrap {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--side) 0%, #12202b 60%, #0f3d2e 100%);
}
.login-card {
  width: 340px; background: #fff; border-radius: 12px; padding: 36px 32px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 16px 48px rgba(0,0,0,.35);
}
.login-logo { font-size: 24px; font-weight: 700; color: var(--txt); text-align: center; }
.login-sub { font-size: 12px; color: var(--txt-2); text-align: center; margin-top: -8px; }
.login-err { color: #d93026; font-size: 13px; min-height: 16px; text-align: center; }

/* ---------- 三栏骨架 ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }

/* 左栏 */
.sidebar {
  width: 240px; flex: none; background: var(--side); color: #cfd8e3;
  display: flex; flex-direction: column; padding: 14px 12px;
}
.logo { font-size: 17px; font-weight: 700; color: #fff; padding: 4px 6px 14px; }
.logo::before { content: "◆ "; color: var(--brand); }
.btn-new {
  background: var(--brand); color: #fff; border: none; border-radius: 8px;
  padding: 10px; font-size: 14px; margin-bottom: 12px;
}
.btn-new:hover { background: var(--brand-dark); }
.proj-list { flex: 1; overflow-y: auto; }
.proj-item {
  padding: 9px 10px; border-radius: 8px; margin-bottom: 4px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
.proj-item:hover { background: var(--side-2); }
.proj-item.active { background: var(--side-2); box-shadow: inset 0 0 0 1px var(--brand); }
.proj-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #9aa4b2; }
.proj-dot.brain_v1 { background: #f5a623; }
.proj-dot.expert_review { background: #4a90d9; }
.proj-dot.final { background: var(--brand); }
.proj-meta { flex: 1; min-width: 0; }
.proj-name { color: #e8edf3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-time { font-size: 11px; color: #7c8899; }
.side-foot {
  border-top: 1px solid #333d4d; padding-top: 10px; margin-top: 8px;
  display: flex; justify-content: space-between; align-items: center; font-size: 13px;
}
.side-foot button {
  background: none; border: 1px solid #3d4757; color: #9aa4b2;
  border-radius: 6px; padding: 3px 10px; font-size: 12px;
}

/* 中栏 */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-head {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 12px 20px 10px; display: flex; flex-direction: column; gap: 10px;
}
.proj-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.status-chip {
  font-size: 12px; font-weight: 400; padding: 2px 10px; border-radius: 999px;
  background: #eef1f4; color: var(--txt-2);
}
.status-chip.brain_v1 { background: #fdf1dd; color: #b06e00; }
.status-chip.expert_review { background: #e3effb; color: #2563ac; }
.status-chip.final { background: #e2f5ec; color: var(--brand-dark); }

/* 流水线进度条 */
.pipeline { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.pipe-node { display: flex; align-items: center; }
.pipe-dot {
  width: 10px; height: 10px; border-radius: 50%; background: #c8cdd4; flex: none;
}
.pipe-node.active .pipe-dot { background: var(--brand); box-shadow: 0 0 0 4px rgba(0,168,112,.18); }
.pipe-node.active .pipe-label { color: var(--brand-dark); font-weight: 600; }
.pipe-label { font-size: 12px; color: var(--txt-2); margin: 0 6px 0 5px; }
.pipe-link { width: 22px; height: 2px; background: #d8dce2; }

/* 消息流 */
.msg-list { flex: 1; overflow-y: auto; padding: 18px 22px; }
.empty-hint { color: var(--txt-2); text-align: center; margin-top: 60px; }
.msg-row { display: flex; margin-bottom: 14px; }
.msg-row.user { justify-content: flex-end; }
.bubble {
  max-width: 78%; border-radius: 10px; padding: 10px 14px; line-height: 1.7;
  word-break: break-word;
}
.msg-row.user .bubble { background: var(--brand); color: #fff; border-top-right-radius: 2px; white-space: pre-wrap; }
.msg-row.assistant .bubble {
  background: var(--card); border: 1px solid var(--line); border-top-left-radius: 2px;
  flex: 1; max-width: 100%;
}
.msg-name { font-size: 11px; color: var(--txt-2); margin-bottom: 3px; }
.msg-name b { color: var(--brand-dark); }

/* 输入区 */
.input-bar {
  background: var(--card); border-top: 1px solid var(--line);
  padding: 12px 20px; display: flex; gap: 12px; align-items: flex-end;
}
.input-bar textarea { flex: 1; resize: none; }

/* ---------- 右栏 方案面板 ---------- */
.plan-panel {
  width: 360px; flex: none; background: var(--card); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; position: relative;
}
.plan-head {
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.plan-title { font-weight: 600; }
.plan-ops { display: flex; gap: 8px; align-items: center; }
.seg {
  border: 1px solid var(--line); background: #fff; color: var(--txt-2);
  border-radius: 6px; padding: 4px 10px; font-size: 13px;
}
.seg.active { background: #e2f5ec; color: var(--brand-dark); border-color: var(--brand); }
.plan-tip {
  position: absolute; top: 52px; right: 16px; background: var(--brand); color: #fff;
  font-size: 12px; padding: 3px 10px; border-radius: 6px; z-index: 5;
}
.plan-editor {
  flex: 1; border: none; border-radius: 0; resize: none; padding: 14px 16px;
  font-family: Consolas, "Microsoft YaHei", monospace; font-size: 13px; line-height: 1.7;
}
.plan-preview { flex: 1; overflow-y: auto; padding: 14px 18px; }

/* markdown 渲染 */
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 14px 0 8px; line-height: 1.4; }
.markdown-body h1 { font-size: 19px; }
.markdown-body h2 { font-size: 16px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.markdown-body h3 { font-size: 14px; }
.markdown-body p { margin: 8px 0; }
.markdown-body ul, .markdown-body ol { padding-left: 22px; margin: 6px 0; }
.markdown-body blockquote {
  border-left: 3px solid var(--brand); background: #f2faf6;
  padding: 6px 12px; margin: 8px 0; color: #476; border-radius: 0 6px 6px 0;
}
.markdown-body table { border-collapse: collapse; margin: 8px 0; width: 100%; font-size: 13px; }
.markdown-body th, .markdown-body td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; }
.markdown-body th { background: #f2f4f6; }
.markdown-body code { background: #f2f4f6; border-radius: 4px; padding: 1px 5px; font-size: 12.5px; }
.markdown-body strong { color: var(--brand-dark); }

/* ---------- 弹层 ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(20,26,36,.5);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-card {
  width: 460px; background: #fff; border-radius: 12px; padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
  max-height: 86vh; overflow-y: auto;
}
.modal-title { font-size: 16px; font-weight: 600; }
.np-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.np-grid .np-wide { grid-column: 1 / -1; }
.modal-ops { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ---------- claude会话进度提示(大脑气泡上方的小字) ---------- */
.brain-status {
  color: #8a94a6; font-size: 12px; margin: 2px 0 4px;
  display: flex; align-items: center; gap: 6px;
}
.brain-status::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #4c7dff; animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
