/* ===== MC Markets 风格 UI(深色 + 金色) ===== */
:root {
  --bg: #07080f;            /* 官方深底 */
  --bg-sidebar: #0c1220;    /* 侧栏(藏青) */
  --bg-elev: #191f2d;       /* 卡片(藏青面板) */
  --bg-elev2: #222a3a;      /* hover / 气泡 */
  --text: #eef1f6;
  --text-soft: #9aa4b6;
  --text-faint: #6b7688;
  --border: #2a3345;
  --border-soft: #1a2130;
  --accent: #ffbc00;        /* MC 官方金 */
  --accent-hover: #ffd447;
  --accent-soft: rgba(255,188,0,.13);
  --orange1: #ffbc00;       /* logo 三角金 */
  --orange2: #d4960a;
  --green: #22c55e;         /* 官方涨绿 */
  --red: #e74c3c;           /* 官方跌红 */
  --blue: #4f8eff;
  --user-bubble: #222a3a;
  --radius: 14px;
  --font-sans: "Inter", "Noto Sans SC", ui-sans-serif, -apple-system, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.6;
}
.app { display: flex; height: 100vh; overflow: hidden; }

/* ===== MC Markets logo ===== */
.logo-box {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--orange1), var(--orange2));
  color: #fff; font-weight: 800; font-size: 14px; letter-spacing: -.5px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(240,160,48,.3);
}
.hero-logo { width: 54px; height: 54px; border-radius: 15px; font-size: 22px; margin: 0 auto; }
/* 官方 logo 图标(罗盘白+金三角) */
.brand-mark { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.brand-mark.big { width: 60px; height: 60px; display: block; margin: 0 auto; }

/* ===== 侧边栏 ===== */
.sidebar {
  width: 272px; flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 14px 12px;
}
.sidebar-head { padding: 4px 6px 10px; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.brand-titles { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 15px; color: #fff; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: var(--text-faint); margin-top: 1px; }
.new-btn {
  width: 100%; display: flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--accent); color: #0a0b0e; border: none; cursor: pointer;
  padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 700;
  transition: background .15s;
}
.new-btn:hover { background: var(--accent-hover); }
.list-label { font-size: 11.5px; color: var(--text-faint); font-weight: 600; letter-spacing: .5px; padding: 16px 8px 6px; text-transform: uppercase; }
.req-list { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.req-item { padding: 9px 10px; border-radius: 9px; cursor: pointer; margin-bottom: 2px; transition: background .12s; }
.req-item:hover { background: rgba(255,255,255,.04); }
.req-item.active { background: var(--accent-soft); }
.req-item-title { font-size: 13.5px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-item-meta { display: flex; align-items: center; gap: 7px; margin-top: 5px; }
.req-item-time { font-size: 11.5px; color: var(--text-faint); }
.req-item-who-row { margin-top: 4px; }
.req-item-who { font-size: 11px; color: var(--text-faint); }
/* —— 需求归类:分组标题 + 回收站(软删除·可恢复) —— */
.req-group-head { display: flex; align-items: center; gap: 6px; padding: 12px 8px 5px; cursor: pointer; user-select: none; color: var(--text-faint); font-size: 11.5px; font-weight: 700; letter-spacing: .4px; }
.req-group-head:hover { color: var(--text-soft); }
.req-group-head .rg-caret { font-size: 10px; transition: transform .15s; }
.req-group-head.collapsed .rg-caret { transform: rotate(-90deg); }
.req-group-head .rg-icon { font-size: 12px; }
.req-group-head .rg-label { flex: 1; text-transform: uppercase; }
.req-group-head .rg-count { background: rgba(255,255,255,.06); color: var(--text-soft); border-radius: 20px; padding: 1px 8px; font-size: 11px; font-weight: 600; }
.req-group-head.rg-trash .rg-label { color: var(--text-faint); }
.req-group-body.is-trash .req-item { opacity: .6; }
.req-group-body.is-trash .req-item:hover { opacity: 1; }
.req-item-row { display: flex; align-items: flex-start; gap: 6px; }
.req-item-row .req-item-title { flex: 1; min-width: 0; }
.req-act { flex-shrink: 0; background: transparent; border: none; color: var(--text-faint); font-size: 13px; line-height: 1; padding: 1px 4px; border-radius: 6px; cursor: pointer; opacity: 0; transition: opacity .12s, background .12s, color .12s; }
.req-item:hover .req-act { opacity: .65; }
.req-act:hover { opacity: 1 !important; background: rgba(255,255,255,.08); }
.req-act.req-trash:hover { color: var(--red); }
.req-act.req-restore { opacity: .65; }
.req-act.req-restore:hover { color: var(--green); }
.req-act.req-purge { opacity: .65; }
.req-act.req-purge:hover { color: var(--red); }
.badge.st-CHAT { color: #6ea8fe; background: rgba(79,142,255,.15); }
.appr-meta { font-size: 12px; color: var(--text-faint); margin-top: 7px; }
.sidebar-foot { display: flex; align-items: center; gap: 7px; padding: 10px 8px 2px; font-size: 12px; color: var(--text-faint); border-top: 1px solid var(--border-soft); margin-top: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #4b5563; }
.dot.ok { background: var(--green); box-shadow: 0 0 6px rgba(14,203,129,.6); }
.dot.err { background: var(--red); }

/* ===== 状态徽章 ===== */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.st-INTAKE, .badge.st-PLAN { color: #f0c869; background: rgba(240,185,11,.12); }
.badge.st-EXEC, .badge.st-REQOPS { color: #6ea8fe; background: rgba(42,114,229,.16); }
.badge.st-REVIEW { color: #b794f6; background: rgba(139,92,246,.16); }
.badge.st-DELIVER { color: var(--orange1); background: rgba(240,160,48,.15); }
.badge.st-DONE { color: var(--green); background: rgba(14,203,129,.15); }
.badge.st-BLOCKED, .badge.st-ESCALATE { color: var(--red); background: rgba(246,70,93,.15); }

/* ===== 主区 ===== */
.main { flex: 1; display: flex; flex-direction: row; min-width: 0; position: relative; }
.main-center { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.thread { flex: 1; overflow-y: auto; padding: 32px 24px 24px; }
.thread-inner { max-width: 744px; margin: 0 auto; }

/* 右侧常驻进度轨:项目流程始终可见,不随对话滚走 */
.progress-rail { display: none; width: 360px; flex-shrink: 0; overflow-y: auto; padding: 28px 22px; border-left: 1px solid var(--border-soft); background: rgba(255,255,255,.015); }
.progress-rail.show { display: block; }
/* 产出预览在窄栏里高度收敛,想看全用产出条上的"新标签全屏打开" */
.progress-rail .deliv-frame { height: 420px; }
.progress-rail .deliv-content { margin-bottom: 10px; }
.rail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.rail-head .avatar { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, var(--orange1), var(--orange2)); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.rail-head .who-name { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.rail-meta { flex-direction: column; align-items: flex-start; gap: 5px; }
.rail-meta .rm-dot { display: none; }
.rail-section-title { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .4px; text-transform: uppercase; margin: 4px 0 10px; }
.rail-note { color: var(--text-soft); font-size: 13px; margin: 2px 0 0; line-height: 1.6; }
.rail-live { margin-top: 14px; display: flex; align-items: center; gap: 8px; color: var(--text-soft); font-size: 12.5px; }
.rail-resume { margin-top: 12px; width: 100%; padding: 9px 12px; border-radius: 8px; border: none; cursor: pointer; font-size: 13px; font-weight: 700; background: var(--accent); color: #0a0b0e; transition: background .15s; }
.rail-resume:hover { background: var(--accent-hover); }
.rail-resume:disabled { opacity: .6; cursor: default; }
/* 进度轨内的步进器改为竖排,读作自上而下的清单 */
.progress-rail .stepper { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 0; margin: 0 0 6px; }
.progress-rail .step { gap: 10px; padding: 3px 0; }
.progress-rail .step-line { width: 1.5px; height: 16px; margin: 1px 0 1px 10px; }
/* 审批流程规范:内嵌 iframe 铺满主区(替代新标签打开) */
.flow-embed { position: absolute; inset: 0; background: var(--bg); }
.flow-frame { width: 100%; height: 100%; border: 0; display: block; }

/* 空态 / 新建 */
.hero { max-width: 744px; margin: 13vh auto 0; text-align: center; padding: 0 24px; }
.hero h1 { font-weight: 700; font-size: 30px; margin: 20px 0 8px; letter-spacing: .3px; color: #fff; }
.hero p { color: var(--text-soft); margin: 0; font-size: 15px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 28px; }
.suggest button {
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text-soft);
  padding: 8px 15px; border-radius: 20px; font-size: 13px; cursor: pointer; transition: all .12s;
}
.suggest button:hover { border-color: var(--accent); color: var(--accent); }

/* ===== 消息 ===== */
.msg { margin: 0 0 26px; }
.req-meta-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; color: var(--text-faint); margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.req-meta-bar .rm-id { font-family: ui-monospace, monospace; color: var(--accent); background: rgba(255,188,0,.1); padding: 1px 7px; border-radius: 5px; font-weight: 600; }
.rm-dot { opacity: .45; margin: 0 3px; }
.am-k { opacity: .7; }
.msg-user { display: flex; justify-content: flex-end; }
.msg-user > div { display: flex; flex-direction: column; align-items: flex-end; max-width: 80%; }
.msg-time { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.msg-ai .msg-time { margin-top: 6px; }
.msg-user .bubble {
  background: var(--user-bubble); border: 1px solid var(--border); border-radius: 16px; padding: 12px 16px;
  width: fit-content; max-width: 100%; font-size: 15px; white-space: pre-wrap; word-break: break-word; color: var(--text);
}
.msg-resubmit { margin-top: 6px; background: transparent; border: 1px solid var(--border); color: var(--text-faint); font-family: inherit; font-size: 12px; padding: 3px 10px; border-radius: 8px; cursor: pointer; transition: border-color .12s, color .12s; }
.msg-resubmit:hover { border-color: var(--accent); color: var(--accent); }
/* 行内编辑框(ChatGPT 式):点「编辑重新提交」后气泡原地变可编辑 */
.msg-user .edit-box { display: block; width: 100%; max-width: 100%; box-sizing: border-box; background: var(--bg-elev); border: 1px solid var(--accent); border-radius: 16px; padding: 12px 14px; box-shadow: 0 0 0 3px var(--accent-soft); }
.edit-input { display: block; width: 100%; box-sizing: border-box; background: transparent; border: 0; outline: none; resize: none; color: var(--text); font-family: inherit; font-size: 15px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow-y: auto; }
.edit-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.edit-actions button { font-family: inherit; font-size: 13px; font-weight: 600; padding: 6px 18px; border-radius: 20px; cursor: pointer; transition: border-color .12s, color .12s, filter .12s; }
.edit-cancel { background: transparent; border: 1px solid var(--border); color: var(--text-soft); }
.edit-cancel:hover { border-color: var(--text-soft); color: var(--text); }
.edit-send { background: var(--accent); border: 1px solid var(--accent); color: #0a0b0e; }
.edit-send:hover { filter: brightness(1.08); }
.msg-ai .who, .progress-card .who { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.msg-ai .avatar, .progress-card .avatar { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, var(--orange1), var(--orange2)); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.msg-ai .who-name, .progress-card .who-name { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.msg-ai .body { font-size: 15px; }
.msg-ai .body :first-child { margin-top: 0; }
.msg-ai .body :last-child { margin-bottom: 0; }

/* 进度面板(置顶) */
.progress-card { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin: 0 0 24px; background: rgba(255,255,255,.025); }
.progress-card .who { margin-bottom: 12px; }
.ext-hint { color: var(--text-faint); font-size: 13px; padding: 4px 0 16px; }

/* 进度步进 */
.stepper { display: flex; align-items: center; gap: 0; margin: 16px 0 22px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; }
.step-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; border: 1.5px solid var(--border); color: var(--text-faint); background: var(--bg-elev); flex-shrink: 0; }
.step.done .step-dot { background: var(--accent); border-color: var(--accent); color: #0a0b0e; font-weight: 700; }
.step.current .step-dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.step-name { font-size: 12px; color: var(--text-faint); }
.step.done .step-name, .step.current .step-name { color: var(--text); font-weight: 500; }
.step-line { width: 26px; height: 1.5px; background: var(--border); margin: 0 6px; }

/* 时间线 */
.timeline { border-left: 2px solid var(--border); margin: 6px 0 6px 6px; padding-left: 16px; }
.tl-item { position: relative; padding: 6px 0; }
.tl-item::before { content: ''; position: absolute; left: -22px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px rgba(240,185,11,.5); }
.tl-time { font-size: 11.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.tl-text { font-size: 14px; margin-top: 1px; color: var(--text); }

/* 卡片 */
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.card-title { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .4px; text-transform: uppercase; margin-bottom: 8px; }
.deliv { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: border-color .12s, background .12s; background: var(--bg-elev); }
.deliv:hover { border-color: var(--accent); background: var(--accent-soft); }
.deliv .file-ic { color: var(--accent); flex-shrink: 0; }
.deliv .file-name { font-size: 13.5px; font-weight: 500; word-break: break-all; }
.deliv-content { display: none; margin: 4px 0 14px; }
.deliv-tag { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px; font-size: 12px; color: var(--text-faint); }
.preview-bar a { color: var(--accent); text-decoration: none; font-weight: 600; }
.preview-bar a:hover { text-decoration: underline; }
.deliv-frame { width: 100%; height: 640px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.deliv-img { max-width: 100%; border: 1px solid var(--border); border-radius: 10px; display: block; }

/* markdown 渲染 */
.md h1 { font-size: 22px; margin: 18px 0 10px; color: #fff; }
.md h2 { font-size: 18px; margin: 18px 0 8px; color: #fff; }
.md h3 { font-size: 15.5px; margin: 14px 0 6px; color: var(--text); }
.md p { margin: 8px 0; }
.md ul, .md ol { margin: 8px 0; padding-left: 22px; }
.md li { margin: 3px 0; }
.md code { background: #23262f; padding: 1px 5px; border-radius: 5px; font-size: 13px; font-family: ui-monospace, Menlo, monospace; color: var(--accent); }
.md pre { background: #0d0e12; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
.md pre code { background: none; padding: 0; color: var(--text); }
.md strong { font-weight: 700; color: #fff; }
.md a { color: var(--accent); }
.md table { border-collapse: collapse; margin: 10px 0; font-size: 13.5px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.md th { background: var(--bg-elev2); color: #fff; }

/* 打字动画 */
.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: bounce 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes bounce { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

/* ===== 输入框 ===== */
.composer-wrap { padding: 0 24px 20px; }
.composer {
  max-width: 744px; margin: 0 auto; position: relative;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 24px; padding: 12px 94px 12px 18px;
  transition: border-color .15s, box-shadow .15s;
}
/* 拖拽上传浮层 */
.drop-hint { display: none; position: absolute; inset: 0; z-index: 30; align-items: center; justify-content: center; background: rgba(7,8,15,.82); backdrop-filter: blur(2px); pointer-events: none; }
.main.dragging .drop-hint { display: flex; }
.drop-hint-inner { border: 2px dashed var(--accent); border-radius: 18px; padding: 40px 60px; color: var(--accent); font-size: 20px; font-weight: 700; text-align: center; }
.drop-hint-inner span { display: block; margin-top: 6px; font-size: 13px; font-weight: 400; color: var(--text-soft); }
.import-box.drag { border-color: var(--accent); background: var(--accent-soft); }
.attach-btn { position: absolute; right: 50px; bottom: 9px; width: 34px; height: 34px; border-radius: 50%; border: none; background: transparent; color: var(--text-faint); cursor: pointer; display: grid; place-items: center; transition: color .15s, background .15s; }
.attach-btn:hover { color: var(--accent); background: rgba(255,255,255,.06); }
.attach-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.attach-chips:empty { display: none; }
.chip-file { display: inline-flex; align-items: center; gap: 5px; background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 8px; padding: 3px 5px 3px 9px; font-size: 12px; color: var(--text-soft); }
.chip-file.err { color: var(--red); border-color: rgba(231,76,60,.5); }
.chip-file button { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 3px; }
.chip-file button:hover { color: var(--red); }
.msg-atts { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.msg-att { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,.06); border: 1px solid var(--border); border-radius: 8px; padding: 3px 9px; font-size: 12.5px; color: var(--accent); text-decoration: none; }
.msg-att:hover { background: var(--accent-soft); }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer textarea {
  width: 100%; border: none; outline: none; resize: none; background: transparent;
  font-family: inherit; font-size: 15px; line-height: 1.5; color: var(--text);
  max-height: 200px;
}
.composer textarea::placeholder { color: var(--text-faint); }
.send-btn {
  position: absolute; right: 10px; bottom: 9px; width: 34px; height: 34px;
  border-radius: 50%; border: none; background: var(--accent); color: #0a0b0e;
  cursor: pointer; display: grid; place-items: center; transition: background .15s;
}
.send-btn:hover { background: var(--accent-hover); }
.send-btn:disabled { background: #3a3d46; color: #6b7280; cursor: default; }
.composer-hint { max-width: 744px; margin: 8px auto 0; text-align: center; font-size: 11.5px; color: var(--text-faint); }

/* ===== 优先级(高/中/低) ===== */
.prio-row { display: flex; align-items: center; gap: 6px; padding: 2px 2px 8px; flex-wrap: wrap; }
.prio-k { font-size: 12px; color: var(--text-faint); margin-right: 2px; }
.prio-btn { background: transparent; border: 1px solid var(--border); color: var(--text-soft); font-size: 12px; font-weight: 600; padding: 3px 12px; border-radius: 20px; cursor: pointer; transition: all .12s; }
.prio-btn:hover { border-color: var(--text-soft); color: var(--text); }
.prio-btn.active[data-p="高"] { background: rgba(231,76,60,.16); border-color: var(--red); color: var(--red); }
.prio-btn.active[data-p="中"] { background: rgba(255,188,0,.14); border-color: var(--accent); color: var(--accent); }
.prio-btn.active[data-p="低"] { background: rgba(154,164,182,.14); border-color: var(--text-soft); color: var(--text-soft); }
.prio-tip { font-size: 11px; color: var(--text-faint); margin-left: 6px; }
.prio-badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.prio-badge.prio-high { color: var(--red); background: rgba(231,76,60,.16); }
.prio-badge.prio-mid { color: var(--accent); background: rgba(255,188,0,.14); }
.prio-badge.prio-low { color: var(--text-soft); background: rgba(154,164,182,.14); }
/* 超时待审:整卡描边提醒 + 标记 */
.appr-card.overdue { border-color: rgba(231,76,60,.55); }
.wait-over { color: var(--red); font-weight: 600; }
.wait-flag { display: inline-block; margin-left: 7px; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 20px; color: var(--red); background: rgba(231,76,60,.14); }
.wait-flag.ghost { color: var(--text-faint); background: rgba(154,164,182,.12); }
.wait-flag.esc { color: #0a0b0e; background: var(--accent); }

/* ===== Skill Studio ===== */
.nav-btn { width: 100%; margin-top: 8px; background: transparent; border: 1px solid var(--border); color: var(--text-soft); padding: 8px 12px; border-radius: 10px; font-size: 13.5px; cursor: pointer; transition: all .12s; }
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.studio { max-width: 1080px; margin: 0 auto; padding: 28px 24px 60px; }
.studio-head h1 { font-size: 24px; margin: 0 0 4px; color: #fff; }
.studio-head p { color: var(--text-soft); margin: 0 0 22px; font-size: 14px; }
.studio-grid { display: grid; grid-template-columns: 1fr 400px; gap: 26px; align-items: start; }
.import-box { border: 1px dashed var(--border); border-radius: 11px; padding: 12px 14px; margin-bottom: 18px; background: rgba(240,185,11,.04); }
.import-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn-ghost.small, .btn-primary.small { padding: 6px 13px; font-size: 13px; }
.small { font-size: 12.5px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.fi { width: 100%; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 9px; color: var(--text); font-family: inherit; font-size: 14px; padding: 9px 12px; outline: none; transition: border-color .12s; }
.fi:focus { border-color: var(--accent); }
textarea.fi { resize: vertical; line-height: 1.55; min-height: 62px; }
.agent-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chk { display: flex; align-items: center; gap: 7px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 20px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.chk input { accent-color: var(--accent); }
.chk em { color: var(--text-faint); font-style: normal; font-size: 11px; margin-left: 5px; }
.studio-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn-primary { background: var(--accent); color: #0a0b0e; border: none; font-weight: 700; padding: 10px 20px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: #3a3d46; color: #6b7280; }
.btn-ghost { background: transparent; color: var(--text-soft); border: 1px solid var(--border); padding: 10px 18px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.install-result { margin-top: 14px; font-size: 13.5px; }
.install-result .ok { color: var(--green); display: block; }
.install-result .err { color: var(--red); display: block; }
.install-result .muted { color: var(--text-faint); }
.studio-side { position: sticky; top: 20px; }
.side-title { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.skillmd-preview { background: #0d0e12; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; line-height: 1.55; color: var(--text-soft); white-space: pre-wrap; word-break: break-word; max-height: 460px; overflow-y: auto; }
.draft-list { display: flex; flex-direction: column; gap: 8px; }
.draft-item { display: flex; align-items: center; justify-content: space-between; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; }
.draft-name { font-size: 13.5px; font-weight: 600; }
.draft-ops { display: flex; gap: 6px; }
.mini { background: var(--accent); color: #0a0b0e; border: none; border-radius: 7px; padding: 4px 11px; font-size: 12px; font-weight: 600; cursor: pointer; }
.mini.ghost { background: transparent; color: var(--text-faint); border: 1px solid var(--border); }
.muted { color: var(--text-faint); }
@media (max-width: 860px) { .studio-grid { grid-template-columns: 1fr; } .studio-side { position: static; } }

/* ===== 登录 / 用户 ===== */
.login-overlay { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.login-box { width: 360px; max-width: 90vw; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px; text-align: center; }
.login-box h2 { margin: 0 0 6px; font-size: 20px; color: #fff; }
.login-box .fi { margin-top: 16px; text-align: center; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 6px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; }
.uc-info { flex: 1; min-width: 0; }
.uc-name { font-size: 13px; font-weight: 600; color: var(--text); }
.uc-role { font-size: 11px; color: var(--accent); margin-top: 1px; }
.uc-logout { background: transparent; border: none; color: var(--text-faint); cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 6px; }
.uc-logout:hover { color: var(--red); background: rgba(255,255,255,.05); }

/* ===== 审批中心 ===== */
.nav-badge { display: inline-block; margin-left: 7px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 9px; padding: 0 5px; }
.appr-list { display: flex; flex-direction: column; gap: 12px; max-width: 820px; }
.appr-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.appr-main { flex: 1; min-width: 0; }
.appr-top { display: flex; align-items: center; gap: 9px; }
.appr-title { font-size: 15px; font-weight: 600; }
.appr-sub { font-size: 13px; color: var(--text-soft); margin-top: 5px; }
.appr-skillbody { margin-top: 10px; }
.appr-reject { display: none; align-items: center; gap: 8px; margin-top: 10px; }
.appr-reject .fi { flex: 1; }
.appr-result { margin-top: 8px; font-size: 13px; }
.appr-result .ok { color: var(--green); }
.appr-result .err { color: var(--red); }
.appr-ops { display: flex; flex-direction: column; gap: 7px; flex-shrink: 0; }
.appr-ops .mini { min-width: 96px; }

/* 审批中心:概览 + 筛选 chips */
.appr-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; max-width: 820px; margin: 4px 0 16px; }
.appr-chip { display: inline-flex; align-items: center; gap: 6px; font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-soft); background: var(--bg-elev); border: 1px solid var(--border); border-radius: 20px; padding: 4px 12px; cursor: pointer; transition: border-color .12s, color .12s, background .12s; }
.appr-chip:hover:not(:disabled) { border-color: var(--text-faint); color: var(--text); }
.appr-chip.active { color: #0a0b0e; background: var(--accent); border-color: var(--accent); }
.appr-chip:disabled { opacity: .4; cursor: default; }
.appr-chip .chip-n { font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 20px; background: rgba(255,255,255,.08); }
.appr-chip.active .chip-n { background: rgba(0,0,0,.18); }
.appr-chip.chip-warn.active { background: var(--red); border-color: var(--red); color: #fff; }
.appr-bar-sep { width: 1px; align-self: stretch; background: var(--border); margin: 2px 4px; }

/* 勾选框(批量批准) */
.appr-pick { flex-shrink: 0; display: flex; align-items: center; padding-top: 3px; cursor: pointer; }
.appr-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* 分级审批进度点 */
.appr-gate { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.gate-dots { display: inline-flex; gap: 4px; }
.gate-dots .gd { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.gate-dots .gd.done { background: var(--green); }
.gate-dots .gd.now { background: var(--accent); box-shadow: 0 0 0 3px rgba(255,188,0,.18); }
.gate-txt { font-size: 12px; color: var(--text-soft); font-weight: 600; }

/* NEXT-STEPS-01:对话内「下一步建议」卡片 —— 卡住/待处理时给出路 */
.ns-card { margin: 8px 0 20px; padding: 14px 16px; border: 1px solid var(--border); border-left-width: 3px; border-radius: 12px; background: var(--bg-elev); }
.ns-head { display: flex; align-items: center; gap: 8px; }
.ns-ic { font-size: 16px; line-height: 1; }
.ns-title { font-size: 14.5px; font-weight: 700; color: var(--text); }
.ns-body { font-size: 13.5px; line-height: 1.7; color: var(--text-soft); margin-top: 6px; }
.ns-body b { color: var(--text); font-weight: 600; }
.ns-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ns-hint { font-size: 12px; color: var(--text-faint); margin-top: 10px; line-height: 1.6; }
.ns-btn { font-family: inherit; font-size: 13px; font-weight: 600; color: #0a0b0e; background: var(--accent); border: 1px solid var(--accent); border-radius: 9px; padding: 7px 14px; cursor: pointer; transition: filter .12s, background .12s, border-color .12s; }
.ns-btn:hover { filter: brightness(1.08); }
.ns-btn:disabled { opacity: .55; cursor: default; }
.ns-btn.ghost { color: var(--text-soft); background: transparent; border-color: var(--border); }
.ns-btn.ghost:hover { color: var(--text); border-color: var(--text-faint); filter: none; }
.ns-btn.ghost.danger { color: var(--red); border-color: rgba(231,76,60,.45); }
.ns-btn.ghost.danger:hover { background: rgba(231,76,60,.12); border-color: var(--red); }
/* 状态色条:受阻=红、待澄清=金、验收/审批=蓝、进行中=淡、完成/取消=中性 */
.ns-card.ns-blocked { border-left-color: var(--red); background: rgba(231,76,60,.05); }
.ns-card.ns-ask { border-left-color: var(--accent); background: rgba(255,188,0,.05); }
.ns-card.ns-review { border-left-color: #6ea8fe; background: rgba(79,142,255,.05); }
.ns-card.ns-progress { border-left-color: var(--text-faint); }
.ns-card.ns-done { border-left-color: var(--green); }
/* 进行中卡片里的主按钮降级为幽灵样式(不抢眼,毕竟"通常无需操作") */
.ns-card.ns-progress .ns-btn { color: var(--text-soft); background: transparent; border-color: var(--border); }
.ns-card.ns-progress .ns-btn:hover { color: var(--text); border-color: var(--text-faint); }

/* 人工测试行(仅发布放行项):独立结论,只留痕 */
.appr-test { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.appr-test .at-label { font-size: 12px; font-weight: 600; color: var(--text-faint); }
.appr-test .mini.test-ok { border-color: rgba(14,203,129,.5); color: var(--green); }
.appr-test .mini.test-ok:hover { background: rgba(14,203,129,.12); }
.appr-testnote { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.appr-testnote .fi { flex: 1; }
.tv { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 20px; }
.tv.pass { color: var(--green); background: rgba(14,203,129,.14); }
.tv.fail { color: var(--red); background: rgba(231,76,60,.14); }
.tv.none { color: var(--text-faint); background: rgba(154,164,182,.1); font-weight: 500; }

/* 作废(软删除)按钮与确认框 */
.mini.danger { color: var(--red); border-color: rgba(231,76,60,.5); }
.mini.danger:hover { background: rgba(231,76,60,.14); border-color: var(--red); }
.mini.danger.ghost { border-color: var(--border); }
.appr-del { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding: 10px 12px; border: 1px solid rgba(231,76,60,.35); border-radius: 10px; background: rgba(231,76,60,.06); }
.appr-del .del-warn { flex-basis: 100%; font-size: 12px; color: var(--red); }
.appr-del .fi { flex: 1; min-width: 180px; }

/* 已取消状态徽标 */
.badge.st-CANCELLED { color: var(--text-faint); background: rgba(154,164,182,.14); }

/* 底部批量操作条 */
.appr-batchbar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; max-width: 820px; margin-top: 16px; padding: 12px 16px; background: var(--bg-elev2); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 -4px 18px rgba(0,0,0,.28); }
.appr-batchbar .batch-n { font-size: 13px; font-weight: 600; color: var(--text); }
.appr-batchbar .batch-sp { flex: 1; }
.appr-batchbar .batch-result { margin-left: 4px; }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }

/* 窄屏:进度轨改为置顶横条,步进器恢复横排 */
@media (max-width: 960px) {
  .main { flex-direction: column; }
  .progress-rail { width: auto; max-height: 42vh; border-left: none; border-bottom: 1px solid var(--border-soft); padding: 16px 18px; order: -1; }
  .progress-rail .stepper { flex-direction: row; align-items: center; flex-wrap: wrap; margin: 4px 0 6px; }
  .progress-rail .step { gap: 8px; padding: 0; }
  .progress-rail .step-line { width: 22px; height: 1.5px; margin: 0 6px; }
  .rail-meta { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 720px) {
  .sidebar { width: 220px; }
  .thread { padding: 20px 14px; }
  .composer-wrap { padding: 0 14px 14px; }
}

/* ============================================================
   UI 增强 v2 (2026-07-23):去单调——明显提亮卡片层次 + 背景光晕 + 金色点睛。
   纯追加、不改上方任何原规则(同选择器靠"后者覆盖"生效)。回滚:删除本段即可(或恢复 styles.css.bak.uienhance-*)。
   ============================================================ */
:root {
  --shadow-card: 0 1px 0 rgba(255,255,255,.05) inset, 0 14px 34px -16px rgba(0,0,0,.72);
  --accent-deep: #d4960a;
  --surf: #18213600;               /* 占位 */
}
/* 背景:更明显的金色光晕 + 蓝辉光 + 整体微渐变,不再死黑一片(固定不随滚动) */
body {
  background:
    radial-gradient(1250px 560px at 14% -14%, rgba(255,188,0,.17), transparent 56%),
    radial-gradient(1050px 600px at 106% -8%, rgba(79,142,255,.11), transparent 54%),
    linear-gradient(180deg, #0b1020, var(--bg) 60%) !important;
  background-attachment: fixed;
}
/* 侧栏:更立体的竖向渐变 + 分隔边 */
.sidebar { background: linear-gradient(180deg, #111b33, #0a0f1c) !important; border-right: 1px solid var(--border); }
/* 卡片/面板:明显提亮的面 + 清晰边框 + 强阴影,从背景里"浮"出来(这是去单调的关键) */
.progress-card, .card, .deliv, .composer, .studio .card, .appr-card {
  background: linear-gradient(180deg, #1a2338, #141b2c) !important;
  border-color: #2d3a54 !important;
  box-shadow: var(--shadow-card);
}
/* 右侧进度轨:给个淡底,和中间对话区分开 */
.progress-rail { background: linear-gradient(180deg, rgba(255,188,0,.02), rgba(255,255,255,.015)) !important; }
/* AI 回复正文:极淡底 + 左金条,像卡片而非裸文字 */
.msg-ai .body {
  background: rgba(255,255,255,.022); border: 1px solid var(--border-soft);
  border-left: 2px solid rgba(255,188,0,.5); border-radius: 4px 12px 12px 12px;
  padding: 12px 15px; box-shadow: var(--shadow-card);
}
/* 用户气泡:提亮 + 阴影 */
.msg-user .bubble { background: linear-gradient(180deg, #26314a, #1e2942) !important; box-shadow: var(--shadow-card); }
/* 新建需求:金色渐变 + 发光 + hover 上浮 */
.new-btn {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent)) !important;
  box-shadow: 0 6px 20px -5px rgba(255,188,0,.65), 0 0 0 1px rgba(255,188,0,.3) inset;
  transition: transform .12s, filter .12s, box-shadow .12s;
}
.new-btn:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 12px 28px -5px rgba(255,188,0,.78); }
/* 需求项:hover 更明显、选中金左条 + 提亮 */
.req-item:hover { background: rgba(255,255,255,.055) !important; }
.req-item.active { background: var(--accent-soft) !important; box-shadow: inset 3px 0 0 var(--accent); }
/* 状态徽章:加细边更清晰 */
.badge.st-INTAKE, .badge.st-PLAN { border: 1px solid rgba(240,185,11,.4); }
.badge.st-EXEC, .badge.st-REQOPS { border: 1px solid rgba(79,142,255,.45); }
.badge.st-REVIEW { border: 1px solid rgba(139,92,246,.45); }
.badge.st-DELIVER { border: 1px solid rgba(240,160,48,.45); }
.badge.st-DONE { border: 1px solid rgba(34,197,94,.45); }
.badge.st-BLOCKED, .badge.st-ESCALATE { border: 1px solid rgba(244,88,106,.45); }
.badge.st-CHAT { border: 1px solid rgba(110,168,254,.45); }
/* 头像 / logo:金色光晕 */
.msg-ai .avatar, .progress-card .avatar, .rail-head .avatar, .logo-box {
  box-shadow: 0 3px 14px -3px rgba(255,188,0,.55), 0 0 0 1px rgba(255,188,0,.22) inset;
}
/* 进度步进:当前步金色发光、已完成步微光 */
.step.current .step-dot { box-shadow: 0 0 0 4px var(--accent-soft), 0 0 14px -2px var(--accent); }
.step.done .step-dot { box-shadow: 0 2px 10px -3px rgba(255,188,0,.6); }
/* 交付物卡片:hover 上浮金边 */
.deliv { transition: border-color .12s, background .12s, transform .12s, box-shadow .12s; }
.deliv:hover { transform: translateX(3px); border-color: var(--accent) !important; }
/* 发送按钮:金色渐变 */
.send-btn:not(:disabled) { background: linear-gradient(135deg, var(--accent-hover), var(--accent)); box-shadow: 0 4px 16px -4px rgba(255,188,0,.6); }
/* 空态大标题:金色微光 */
.hero h1 { text-shadow: 0 2px 40px rgba(255,188,0,.2); }
/* 滚动条:细、深、hover 变亮 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #263252; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #35456e; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   FLOW-VIZ-01 (2026-07-23):pm 分发流程可视化。受理→各执行阶段→质检→审批各道→归档,
   受阻步标红并直接显示原因,需求方一眼看到卡在哪、为什么。回滚删除本段即可。
   ============================================================ */
.flow-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 13px; }
.flow-chip { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 20px; background: rgba(255,255,255,.06); color: var(--text-soft); border: 1px solid var(--border); }
.flow-chip.ext { color: var(--accent); background: var(--accent-soft); border-color: rgba(255,188,0,.35); }
.flow-chip.risk { color: var(--red); background: rgba(244,88,106,.12); border-color: rgba(244,88,106,.4); }
.flow { display: flex; flex-direction: column; }
.flow-step { position: relative; display: flex; gap: 11px; padding-bottom: 14px; }
.flow-step:last-child { padding-bottom: 0; }
.flow-rod { position: absolute; left: 8px; top: 19px; bottom: -1px; width: 2px; background: var(--border); }
.flow-rod.done { background: var(--green); }
.flow-pin { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 10px; font-weight: 700; z-index: 1; background: var(--bg-elev2); border: 2px solid var(--border); color: var(--text-faint); }
.flow-step.done .flow-pin { background: var(--green); border-color: var(--green); color: #04210f; }
.flow-step.current .flow-pin { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.flow-step.blocked .flow-pin { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 0 0 4px rgba(244,88,106,.2); }
.flow-label { font-size: 13px; color: var(--text-soft); }
.flow-step.done .flow-label { color: var(--text); }
.flow-step.current .flow-label { color: var(--accent); font-weight: 700; }
.flow-step.blocked .flow-label { color: #ff9aa5; font-weight: 700; }
.flow-why { display: block; font-size: 11px; font-weight: 400; color: var(--text-faint); margin-top: 2px; line-height: 1.45; }
.flow-why.blocked { color: #ff8791; }
/* 右栏「项目进度」卡内的任务分发流程:一行路由概要(.ds-sum) + 竖排时间轴(.flow) */
.ds-sum { font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 11px; }

/* ===== ICON-SYS-01(2026-07-24)图标系统化:emoji → 统一线性 SVG 的尺寸/对齐 ===== */
.nav-btn { display: flex; align-items: center; gap: 10px; text-align: left; }
.nav-btn svg { width: 17px; height: 17px; flex: none; color: var(--text-faint); transition: color .12s; }
.nav-btn:hover svg { color: var(--accent); }
.nav-badge { margin-left: auto; }
.req-group-head .rg-icon { display: inline-flex; align-items: center; }
.req-group-head .rg-icon svg { width: 14px; height: 14px; display: block; }
.req-act svg { width: 14px; height: 14px; display: block; }
.req-item-who { display: inline-flex; align-items: center; gap: 4px; }
.req-item-who svg { width: 11px; height: 11px; flex: none; }
.rg-batch { display: inline-flex; align-items: center; gap: 4px; }
.rg-batch svg { width: 12px; height: 12px; flex: none; }
