/* ═══════════════════════════════════════════════════════════════
   AI 小说创作工作台 —— 深色主题
   审美取向：VSCode 的信息密度 + 纸书的阅读舒适度
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #16181c;
  --bg-2: #1b1e23;
  --bg-3: #21252b;
  --bg-4: #282c34;
  --line: #32373f;
  --line-2: #3d434d;
  --fg: #dfe3ea;
  --fg-2: #a8b0bd;
  --fg-3: #6f7885;
  --gold: #d4a94a;
  --gold-dim: #8a6f2e;
  --accent: #5c9cf5;
  --green: #5cc98a;
  --red: #e5686d;
  --orange: #e0a34e;
  --purple: #a98af0;
  --paper: #1c1f24;
  --radius: 8px;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --sans: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --serif: "Songti SC", "SimSun", "Source Han Serif SC", "Noto Serif CJK SC", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font: 14px/1.6 var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3a4048; border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #4c545e; }

.hidden { display: none !important; }
.grow { flex: 1; }
.muted { color: var(--fg-3); font-size: 12px; }
.view { height: 100vh; display: flex; flex-direction: column; }

/* ───────────────────────────── 按钮与控件 ───────────────────────────── */

.btn {
  border: 1px solid var(--line-2); background: var(--bg-3); color: var(--fg);
  padding: 7px 14px; border-radius: 6px; cursor: pointer; font-size: 13px;
  font-family: inherit; transition: .13s; white-space: nowrap;
}
.btn:hover { background: var(--bg-4); border-color: #4d545f; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1a1a1a; font-weight: 600; }
.btn.primary:hover { background: #e0b75b; }
.btn.accent { background: #2f4a72; border-color: #3d5f8f; color: #dbe9ff; font-weight: 600; }
.btn.accent:hover { background: #385780; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: #5c3336; }
.btn.danger:hover { background: #3a2426; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.tool {
  padding: 4px 9px; font-size: 12px; background: transparent;
  border-color: transparent; color: var(--fg-2);
}
.btn.tool:hover { background: var(--bg-4); color: var(--fg); border-color: var(--line); }
.btn.tool.warn:hover { color: var(--orange); }
.btn.tool.busy { color: var(--gold); background: #2a2519; }

.icon-btn {
  width: 28px; height: 28px; border: none; background: transparent; color: var(--fg-2);
  border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1;
  display: grid; place-items: center;
}
.icon-btn:hover { background: var(--bg-4); color: var(--fg); }
.icon-btn.sm { width: 24px; height: 24px; font-size: 13px; }

input, textarea, select {
  font-family: inherit; font-size: 13px; color: var(--fg);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 9px; outline: none; width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold-dim); }
textarea { resize: vertical; line-height: 1.65; }
select { cursor: pointer; }
label.fld { display: block; margin-bottom: 12px; }
label.fld > span { display: block; font-size: 12px; color: var(--fg-2); margin-bottom: 5px; }
.mini-select { width: auto; padding: 4px 6px; font-size: 12px; }
.mini-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--fg-2); cursor: pointer; width: auto; }
.mini-check input { width: auto; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

/* ───────────────────────────── 书架 ───────────────────────────── */

.shelf-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--gold), #9a7b25); color: #1a1a1a;
  font: 700 22px/1 var(--serif);
}
.brand h1 { font-size: 17px; font-weight: 600; letter-spacing: .3px; }
.brand p { font-size: 12px; color: var(--fg-3); margin-top: 2px; }
.shelf-actions { display: flex; align-items: center; gap: 10px; }
.usage-badge { font: 11px var(--mono); color: var(--fg-3); }

.shelf-body { flex: 1; overflow: auto; padding: 24px 28px 60px; }
.shelf-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.shelf-head h2 { font-size: 15px; font-weight: 600; }

.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #2a2519; border: 1px solid var(--gold-dim); border-radius: var(--radius);
  padding: 13px 16px; margin-bottom: 20px; font-size: 13px;
}
.banner b { color: var(--gold); }
.banner span { color: var(--fg-2); flex: 1; min-width: 260px; }

.shelf-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
}
.book-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; cursor: pointer; transition: .16s; position: relative;
}
.book-card:hover { transform: translateY(-3px); border-color: var(--gold-dim); box-shadow: 0 10px 26px #0007; }
.book-cover {
  height: 132px; padding: 14px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
}
.book-cover::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(#ffffff30, #00000040);
}
.book-cover h3 {
  font: 600 17px/1.35 var(--serif); color: #f2ece0; letter-spacing: .5px;
  text-shadow: 0 1px 3px #0006; max-height: 70px; overflow: hidden;
}
.book-cover .bc-genre { font-size: 11px; color: #ffffffaa; }
.book-info { padding: 10px 13px 12px; }
.book-info .bi-log {
  font-size: 12px; color: var(--fg-2); line-height: 1.5; height: 36px; overflow: hidden;
}
.book-meta { display: flex; justify-content: space-between; font: 11px var(--mono); color: var(--fg-3); margin-top: 8px; }
.book-del {
  position: absolute; right: 6px; top: 6px; opacity: 0; transition: .15s;
  background: #00000088; backdrop-filter: blur(3px);
}
.book-card:hover .book-del { opacity: 1; }
.card-new {
  border: 1px dashed var(--line-2); background: transparent; display: grid; place-items: center;
  min-height: 200px; color: var(--fg-3); font-size: 13px; gap: 6px; cursor: pointer; border-radius: 10px;
}
.card-new:hover { border-color: var(--gold-dim); color: var(--gold); }
.card-new span { font-size: 26px; }
.empty-hint { color: var(--fg-3); font-size: 13px; padding: 40px 0; text-align: center; }

/* ───────────────────────────── 工作台顶栏 ───────────────────────────── */

.topbar {
  height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 6px;
  background: var(--bg-2); border-bottom: 1px solid var(--line); flex-shrink: 0;
}
#btn-back { font-size: 22px; }
.topbar-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.topbar-title b { font: 600 14px var(--serif); letter-spacing: .4px; white-space: nowrap; }
.crumb { font-size: 12px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.model-badge { font: 11px var(--mono); color: var(--fg-3); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipe-status { font-size: 12px; color: var(--gold); font-family: var(--mono); }

/* ───────────────────────────── 三栏布局 ───────────────────────────── */

.layout { flex: 1; display: flex; min-height: 0; }
.pane { display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.pane.side { width: 268px; flex-shrink: 0; background: var(--bg-2); border-right: 1px solid var(--line); }
.pane.chat { width: 390px; flex-shrink: 0; border-right: 1px solid var(--line); background: var(--bg-2); }
.pane.editor { flex: 1; min-width: 320px; }
.splitter { width: 4px; cursor: col-resize; background: transparent; flex-shrink: 0; margin: 0 -2px; z-index: 5; }
.splitter:hover, .splitter.dragging { background: var(--gold-dim); }

/* ── 左栏 */
.side-tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
.side-tabs::-webkit-scrollbar { display: none; }
.side-tabs .tab {
  flex: none; padding: 9px 11px; background: transparent; border: none; cursor: pointer;
  color: var(--fg-3); font-size: 12px; border-bottom: 2px solid transparent; font-family: inherit;
}
.side-tabs .tab:hover { color: var(--fg); }
.side-tabs .tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.side-body { flex: 1; overflow: auto; padding: 8px; }

.side-sec-head {
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 8px;
  font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: .6px;
}
.side-sec-head .grow { flex: 1; }

.vol { margin-bottom: 6px; }
.vol-head {
  display: flex; align-items: center; gap: 5px; padding: 5px 6px; border-radius: 5px;
  font-size: 12px; color: var(--fg-2); cursor: pointer; user-select: none;
}
.vol-head:hover { background: var(--bg-3); }
.vol-head b { font-weight: 600; color: var(--fg); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vol-head .caret { font-size: 9px; color: var(--fg-3); width: 10px; }
.vol-chapters { padding-left: 4px; }

.ch-item {
  display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 5px;
  cursor: pointer; font-size: 13px; color: var(--fg-2); position: relative;
}
.ch-item:hover { background: var(--bg-3); }
.ch-item.active { background: #2c3444; color: #fff; }
.ch-item.active::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px;
  background: var(--gold); border-radius: 2px;
}
.ch-no { font: 11px var(--mono); color: var(--fg-3); min-width: 20px; text-align: right; flex-shrink: 0; }
.ch-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.ch-dot.draft { background: #4a5160; }
.ch-dot.writing { background: var(--accent); }
.ch-dot.done { background: var(--green); }
.ch-dot.locked { background: var(--gold); }
.ch-badge { font: 10px var(--mono); color: var(--fg-3); flex-shrink: 0; }
.ch-badge.bad { color: var(--red); }
.ch-item.dragover { box-shadow: inset 0 2px 0 var(--gold); }
.ch-item[draggable="true"] { -webkit-user-drag: element; }

.card-item {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px;
  padding: 9px 10px; margin-bottom: 7px; cursor: pointer; transition: .13s;
}
.card-item:hover { border-color: var(--line-2); background: var(--bg-4); }
.card-item .ci-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.card-item .ci-name { font-weight: 600; font-size: 13px; }
.card-item .ci-tag {
  font-size: 10px; padding: 1px 5px; border-radius: 3px; background: #33445c; color: #a9c7ef;
}
.card-item .ci-tag.main { background: #4a3a1a; color: var(--gold); }
.card-item .ci-tag.villain { background: #4a2426; color: #e79398; }
.card-item .ci-desc { font-size: 12px; color: var(--fg-3); line-height: 1.5; }
.card-item .ci-status { font-size: 11px; color: var(--accent); margin-top: 4px; font-family: var(--mono); }

.fs-item { border-left: 2px solid var(--orange); }
.fs-item.paid { border-left-color: var(--green); opacity: .62; }
.tl-item { border-left: 2px solid var(--purple); }

/* ── 中栏 对话 */
.chat-head {
  height: 36px; display: flex; align-items: center; padding: 0 10px; gap: 8px;
  border-bottom: 1px solid var(--line); font-size: 13px; flex-shrink: 0;
}
.chat-head-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.ctx-badge {
  font: 10px var(--mono); color: var(--green); background: #1e2f26; padding: 2px 6px; border-radius: 3px;
  cursor: help;
}
.quick-bar { display: flex; gap: 5px; padding: 7px 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.chip {
  font-size: 11px; padding: 3px 8px; border-radius: 11px; background: var(--bg-3);
  border: 1px solid var(--line); color: var(--fg-2); cursor: pointer; white-space: nowrap;
}
.chip:hover { background: var(--bg-4); color: var(--fg); border-color: var(--line-2); }

.chat-list { flex: 1; overflow: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; flex-direction: column; gap: 4px; max-width: 100%; }
.msg-role { font-size: 10px; color: var(--fg-3); font-family: var(--mono); display: flex; align-items: center; gap: 6px; }
.msg-body {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
  font-size: 13px; line-height: 1.72; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
}
.msg.user .msg-body { background: #232b36; border-color: #2f3a49; }
.msg.sys .msg-body { background: transparent; border: 1px dashed var(--line); color: var(--fg-3); font-size: 12px; }
.msg.err .msg-body { background: #2e2022; border-color: #5c3336; color: #eba0a4; }
.msg-think {
  font-size: 11px; color: var(--fg-3); font-family: var(--mono); background: #1a1d21;
  border-left: 2px solid var(--line-2); padding: 5px 8px; max-height: 110px; overflow: auto; white-space: pre-wrap;
}
.msg-acts { display: flex; gap: 5px; flex-wrap: wrap; }
.msg-acts .btn { padding: 3px 8px; font-size: 11px; }
.typing::after {
  content: '▍'; color: var(--gold); animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.chat-input-wrap { border-top: 1px solid var(--line); padding: 8px; flex-shrink: 0; }
.ctx-hint {
  font-size: 11px; color: var(--fg-3); background: var(--bg-3); border-radius: 4px;
  padding: 4px 7px; margin-bottom: 6px; max-height: 52px; overflow: hidden;
  border-left: 2px solid var(--accent);
}
#chat-input { background: var(--bg-3); }
.chat-input-bar { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.chat-input-bar .btn { margin-left: auto; }

/* ── 右栏 编辑器 */
.ed-toolbar {
  height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border-bottom: 1px solid var(--line); flex-shrink: 0; background: var(--bg-2);
}
.ed-title {
  background: transparent; border: none; font: 600 14px var(--serif); letter-spacing: .5px;
  padding: 2px 4px; max-width: 320px;
}
.ed-title:focus { background: var(--bg-3); }
.ed-stat { font: 11px var(--mono); color: var(--fg-3); }
.save-state { font: 11px var(--mono); color: var(--fg-3); min-width: 52px; text-align: right; }
.save-state.dirty { color: var(--orange); }
.save-state.saved { color: var(--green); }

.ed-actions {
  display: flex; align-items: center; gap: 2px; padding: 5px 10px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); background: var(--bg-2); flex-shrink: 0;
}

.ed-scroll { flex: 1; overflow: auto; background: var(--bg); }
.ed-paper { max-width: 780px; margin: 0 auto; padding: 26px 34px 200px; }
.outline-strip {
  background: #1f2329; border: 1px solid var(--line); border-left: 3px solid var(--gold-dim);
  border-radius: 6px; padding: 10px 13px; margin-bottom: 22px; font-size: 12.5px;
  color: var(--fg-2); line-height: 1.65; white-space: pre-wrap;
}
.outline-strip .os-title { font-size: 11px; color: var(--gold); margin-bottom: 5px; font-family: var(--mono); }

.ed-body {
  min-height: 60vh; outline: none; font: 17px/1.95 var(--serif);
  color: #e8e4dc; letter-spacing: .3px; caret-color: var(--gold);
}
.ed-body:empty::before {
  content: attr(data-placeholder); color: var(--fg-3); font-family: var(--sans);
  font-size: 14px; line-height: 1.8;
}
.ed-body p { margin: 0 0 1.25em; text-indent: 2em; }
.ed-body p:last-child { margin-bottom: 0; }
.ed-body .hl-issue {
  background: #4a2a2c; border-bottom: 2px solid var(--red); border-radius: 2px;
  animation: flash 1.4s ease-out;
}
@keyframes flash { 0% { background: #7a3a3e; } 100% { background: #4a2a2c; } }
.ed-body.streaming { opacity: .96; }

/* ── 问题面板 */
.problems { border-top: 1px solid var(--line); background: var(--bg-2); flex-shrink: 0; display: flex; flex-direction: column; }
.problems.collapsed .problems-body { display: none; }
.problems.collapsed .pb-toggle { transform: rotate(180deg); }
.problems-head {
  height: 30px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  cursor: pointer; font-size: 12px; user-select: none;
}
.problems-head:hover { background: var(--bg-3); }
.pb-title { color: var(--fg-2); }
.pb-count {
  background: var(--bg-4); color: var(--fg-2); border-radius: 9px; padding: 0 7px; font: 11px var(--mono);
}
.pb-count.bad { background: #4a2426; color: #e79398; }
.pb-score { font: 11px var(--mono); color: var(--fg-3); }
.pb-toggle { color: var(--fg-3); font-size: 10px; transition: .15s; }
.problems-body { max-height: 32vh; overflow: auto; padding: 4px 8px 10px; }

.issue {
  border: 1px solid var(--line); border-left: 3px solid var(--orange); border-radius: 5px;
  padding: 8px 10px; margin-bottom: 6px; background: var(--bg-3); font-size: 12px;
}
.issue.sev-高 { border-left-color: var(--red); }
.issue.sev-中 { border-left-color: var(--orange); }
.issue.sev-低 { border-left-color: var(--fg-3); }
.issue.resolved { opacity: .45; }
.issue-head { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; flex-wrap: wrap; }
.issue-type { font-weight: 600; color: var(--fg); }
.issue-sev { font-size: 10px; padding: 1px 5px; border-radius: 3px; background: var(--bg-4); color: var(--fg-2); }
.issue-quote {
  font-family: var(--serif); color: #d8cfbe; background: #24282e; border-radius: 4px;
  padding: 4px 7px; margin: 4px 0; cursor: pointer; border-left: 2px solid var(--line-2);
}
.issue-quote:hover { background: #2b3038; }
.issue-detail { color: var(--fg-2); line-height: 1.6; }
.issue-evidence { color: var(--fg-3); font-size: 11px; margin-top: 3px; }
.issue-fix {
  margin-top: 5px; padding: 5px 7px; background: #1e2b23; border-radius: 4px;
  color: #b6dcc4; line-height: 1.6; border-left: 2px solid var(--green);
}
.issue-acts { display: flex; gap: 5px; margin-top: 6px; }
.issue-acts .btn { padding: 2px 8px; font-size: 11px; }

/* ───────────────────────────── 弹窗 ───────────────────────────── */

.modal-mask {
  position: fixed; inset: 0; background: #000000b0; backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 100; padding: 24px;
  animation: fade .13s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 11px;
  width: min(720px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px #000a;
}
.modal.wide { width: min(1020px, 100%); }
.modal-head {
  display: flex; align-items: center; padding: 15px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 15px; font-weight: 600; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px 20px; overflow: auto; flex: 1; }
.modal-foot {
  display: flex; gap: 9px; justify-content: flex-end; padding: 13px 20px;
  border-top: 1px solid var(--line);
}
.modal-foot .left { margin-right: auto; }

.sec { margin-bottom: 22px; }
.sec > h4 {
  font-size: 12px; color: var(--gold); text-transform: uppercase; letter-spacing: .8px;
  margin-bottom: 11px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.hint { font-size: 12px; color: var(--fg-3); line-height: 1.6; margin-bottom: 10px; }

.prov-card {
  border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px;
  background: var(--bg-3);
}
.prov-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.prov-head b { font-size: 13px; }
.prov-head .grow { flex: 1; }
.test-result { font: 11px var(--mono); }
.test-result.ok { color: var(--green); }
.test-result.no { color: var(--red); }

.role-grid { display: grid; gap: 9px; }
.role-row {
  display: grid; grid-template-columns: 132px 1fr 1fr 74px; gap: 8px; align-items: center;
}
.role-row .rr-name { font-size: 12px; }
.role-row .rr-name b { display: block; font-size: 13px; }
.role-row .rr-name span { color: var(--fg-3); font-size: 11px; line-height: 1.4; display: block; }
@media (max-width: 780px) { .role-row { grid-template-columns: 1fr; } }

/* 差异对比 */
.diff-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.diff-col { min-width: 0; }
.diff-col h5 { font-size: 11px; color: var(--fg-3); margin-bottom: 7px; font-family: var(--mono); }
.diff-text {
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px;
  font: 15px/1.9 var(--serif); max-height: 56vh; overflow: auto; white-space: pre-wrap;
  word-break: break-word;
}
.diff-text ins { background: #1e3a28; color: #a8e6bd; text-decoration: none; border-radius: 2px; }
.diff-text del { background: #3d2225; color: #e6a8ad; text-decoration: line-through; border-radius: 2px; }
@media (max-width: 860px) { .diff-wrap { grid-template-columns: 1fr; } }

.smell-list { display: flex; flex-direction: column; gap: 6px; }
.smell-row {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px; background: var(--bg-3);
  border-radius: 5px; font-size: 12px;
}
.smell-row .sr-label { font-weight: 600; min-width: 110px; }
.smell-row .sr-count { font: 11px var(--mono); color: var(--orange); }
.smell-row .sr-samples { color: var(--fg-3); flex: 1; }
.score-big { font: 700 34px var(--mono); }
.score-big.good { color: var(--green); }
.score-big.mid { color: var(--orange); }
.score-big.bad { color: var(--red); }

/* 流水线 */
.pipe-steps { display: flex; flex-direction: column; gap: 7px; }
.pipe-step {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 6px;
  background: var(--bg-3); font-size: 13px; border: 1px solid var(--line);
}
.pipe-step .ps-icon { width: 18px; text-align: center; }
.pipe-step.run { border-color: var(--gold-dim); background: #2a2519; }
.pipe-step.ok { border-color: #2e5a3f; }
.pipe-step.ok .ps-icon { color: var(--green); }
.pipe-step.err { border-color: #5c3336; }
.pipe-step.err .ps-icon { color: var(--red); }
.pipe-step .ps-note { margin-left: auto; font: 11px var(--mono); color: var(--fg-3); }

/* Toast */
#toast-root {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 200; align-items: center;
}
.toast {
  background: var(--bg-4); border: 1px solid var(--line-2); border-radius: 7px;
  padding: 9px 16px; font-size: 13px; box-shadow: 0 8px 24px #0008;
  animation: rise .18s; max-width: 70vw;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.toast.ok { border-color: #2e5a3f; color: #b6dcc4; }
.toast.err { border-color: #5c3336; color: #eba0a4; }
.toast.warn { border-color: var(--gold-dim); color: var(--gold); }

.spin {
  display: inline-block; width: 11px; height: 11px; border: 2px solid var(--gold-dim);
  border-top-color: transparent; border-radius: 50%; animation: sp .7s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }

.kv-list { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.kv-list > div { display: flex; gap: 8px; }
.kv-list b { color: var(--fg-2); min-width: 74px; font-weight: 500; }

.tag-inline {
  display: inline-block; font-size: 10px; padding: 1px 5px; border-radius: 3px;
  background: var(--bg-4); color: var(--fg-2); margin-right: 4px;
}
