/* ---------- 首页：场景卡片与链上脉搏 ---------- */
.scenarios { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 22px; }
.scenario {
  display: flex; align-items: center; gap: 12px;
  max-width: 100%; padding: 11px 16px; border-radius: 12px;
  background: var(--card); text-align: left;
  transition: background .15s, transform .15s;
}
.scenario:hover { background: var(--card-hover); transform: translateX(2px); }
.sc-emoji { font-size: 20px; }
.sc-text { display: flex; flex-direction: column; min-width: 0; }
.sc-text b { font-size: 15px; font-weight: 500; }
.sc-text small { font-size: 12px; color: var(--text-3); }

.pulse { margin-top: 28px; }
.pulse-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: .5px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: live 1.8s infinite; }
.pulse-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pulse-col { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .15); }
.pulse-col-head { margin-bottom: 6px; font-size: 12px; color: var(--text-3); }
.pulse-row { display: grid; grid-template-columns: 20px 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 5px 0; }
.pulse-row .tk-icon { grid-row: span 2; width: 20px; height: 20px; border-radius: 50%; background: #2b3139; object-fit: cover; }
.tk-fallback { display: grid; place-items: center; font-size: 10.5px; font-weight: 700; line-height: 1; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.pulse-row b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pulse-row span { font-size: 12px; font-variant-numeric: tabular-nums; }
.pulse-row small { grid-column: 2 / span 2; font-size: 11px; color: var(--text-4); }
.up { color: var(--green); }
.down { color: var(--red); }

/* ---------- 工作区布局 ---------- */
.workspace { flex: 1; min-height: 0; display: none; }
.view-chat .workspace, .view-workspace .workspace { display: flex; }
.chat-col { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.view-workspace .chat-col { flex: none; width: clamp(340px, 31%, 470px); border-right: 1px solid var(--line); background: rgba(10, 12, 16, .25); }
.flow-col { display: none; flex: 1; min-width: 0; flex-direction: column; }
.view-workspace .flow-col { display: flex; animation: slide-in .35s ease-out; }
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } }

.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.chat-inner { max-width: 860px; margin: 0 auto; padding: 28px 24px 12px; }
.view-workspace .chat-inner { padding: 22px 18px 12px; }
.chat-dock { flex: none; padding: 8px 24px 16px; max-width: 908px; width: 100%; margin: 0 auto; }
.view-workspace .chat-dock { padding: 8px 14px 14px; }

/* ---------- 消息 ---------- */
.messages { display: flex; flex-direction: column; gap: 22px; }
.msg-enter { animation: msg-in .3s ease-out; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
.msg-user { align-self: flex-end; max-width: 86%; }
.bubble {
  padding: 10px 14px; border-radius: 16px 16px 4px 16px;
  background: #2b3139; font-size: 14.5px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
}
.bubble.annotation { display: flex; flex-direction: column; gap: 2px; background: rgba(240, 185, 11, .16); border: 1px solid rgba(240, 185, 11, .35); color: #ffe9a8; cursor: pointer; }
.ann-head { font-weight: 600; }
.ann-node { color: #f8d36a; }

.msg-ai { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.content { font-size: 14.5px; line-height: 1.75; word-break: break-word; }
.content p { margin: 0 0 6px; }
.content p:last-child { margin-bottom: 0; }
.content ul { margin: 4px 0; padding-left: 1.2em; }
.content code { padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, .08); font-size: 13px; }
.content .ver { color: var(--brand); }

.thought { align-self: flex-start; color: var(--text-3); font-size: 13px; }
.thought summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; user-select: none; }
.thought summary::-webkit-details-marker { display: none; }
.thought summary:hover { color: var(--text-2); }
.thought .chev { transition: transform .2s; }
.thought[open] .chev { transform: rotate(90deg); }
.thought ul { margin: 8px 0 2px; padding: 2px 0 2px 14px; border-left: 2px solid var(--line-strong); list-style: none; }
.thought li { margin: 3px 0; line-height: 1.6; }

.thinking-live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.thinking-live b { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text-4); }
.shimmer {
  background: linear-gradient(90deg, #6b7380 0%, #eaecef 50%, #6b7380 100%) 0 0 / 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.ai-card { padding: 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(0, 0, 0, .14); }
.ai-card.tight { padding: 4px 12px; }
.budget-note { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 3px 8px; border-radius: 6px; background: rgba(240, 185, 11, .1); font-size: 12px; color: var(--brand); }
.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 12px; }
.option-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px; border-radius: 10px; text-align: left;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .02);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.option-card b { font-size: 14px; font-weight: 600; }
.option-card span { font-size: 12px; line-height: 1.55; color: var(--text-3); }
.option-card:not(:disabled):hover { border-color: #565d68; background: rgba(255, 255, 255, .04); }
.option-card.selected { border-color: var(--brand); background: rgba(240, 185, 11, .08); box-shadow: 0 0 0 1px var(--brand) inset; }
.option-card.selected b { color: var(--brand); }
.option-card:disabled:not(.selected) { opacity: .45; }
.option-card.custom { border-style: dashed; }

.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-yellow, .btn-gray {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 8px;
  font-size: 14px; font-weight: 600;
  transition: background .15s, opacity .15s;
}
.btn-yellow { background: var(--yellow); color: #181a20; }
.btn-yellow:hover:not(:disabled) { background: var(--yellow-hover); }
.btn-yellow:disabled { opacity: .45; }
.btn-yellow.sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-gray { background: #2b3139; color: var(--text-2); }
.btn-gray:hover { background: #343a43; }

.param-group { margin-top: 14px; }
.pg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.pg-head b { font-size: 13.5px; }
.pg-head small { font-size: 12px; color: var(--text-4); }
.pg-options { display: flex; flex-wrap: wrap; gap: 8px; }
.param-chip {
  display: flex; flex-direction: column; align-items: flex-start;
  min-width: 92px; padding: 7px 12px; border-radius: 9px; text-align: left;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .02);
  transition: border-color .15s, background .15s;
}
.param-chip b { font-size: 13.5px; font-weight: 600; }
.param-chip small { font-size: 11.5px; color: var(--text-3); }
.param-chip:not(:disabled):hover { border-color: #565d68; }
.param-chip.selected { border-color: var(--brand); background: rgba(240, 185, 11, .1); }
.param-chip.selected b { color: var(--brand); }
.param-chip:disabled:not(.selected) { opacity: .4; }
.param-mode { display: flex; align-items: center; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-strong); font-size: 12.5px; color: var(--text-3); }

.sc-head { font-size: 15px; }
.sc-sub { font-size: 13.5px; color: var(--text-2); }
.sit-table, .diff-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sit-table th, .diff-table th { padding: 10px 6px 6px; font-size: 12px; font-weight: 500; color: var(--text-3); text-align: left; }
.sit-table td, .diff-table td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; line-height: 1.55; }
.sit-table td:first-child { width: 42%; color: var(--text-2); }
.diff-table th:not(:first-child), .diff-table td:not(:first-child) { text-align: center; white-space: nowrap; }
.diff-table td:first-child { color: var(--text-2); }
.diff-table tr.changed td:nth-child(2) { color: var(--text-3); text-decoration: line-through; }
.diff-table tr.changed b { color: var(--brand); }
.diff-table .muted { color: var(--text-4); }
.sc-notes { margin: 0; padding-left: 1.2em; font-size: 13.5px; line-height: 1.7; color: var(--text-2); }
.sc-audit { font-size: 13.5px; color: var(--text-2); }
.sc-next { padding: 8px 10px; border-radius: 8px; background: rgba(91, 141, 255, .08); font-size: 12.5px; color: #a9bfff; }

.msg-actions { display: flex; gap: 2px; }
.msg-actions .icon-btn { width: 30px; height: 30px; color: var(--text-3); }
.msg-actions .icon-btn:hover, .msg-actions .icon-btn.on { color: var(--text); }

.msg-event {
  align-self: center; display: inline-flex; align-items: flex-start; gap: 8px;
  max-width: 96%; padding: 8px 12px; border-radius: 10px;
  font-size: 12.5px; line-height: 1.6; background: rgba(255, 255, 255, .04); color: var(--text-2);
}
.msg-event .icon { margin-top: 2px; }
.msg-event.tone-success { background: rgba(46, 189, 133, .1); color: #8ee5c0; }
.msg-event.tone-warn { background: rgba(240, 185, 11, .1); color: #f6d47a; }
.messages.busy .option-card, .messages.busy .param-chip { pointer-events: none; }

/* ---------- 右侧策略面板 ---------- */
.flow-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 16px 18px 10px; }
.flow-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.flow-name { padding: 6px 12px; border-radius: 8px; background: #23272e; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ver-chip { padding: 3px 8px; border-radius: 6px; background: rgba(240, 185, 11, .12); color: var(--brand); font-size: 12px; font-weight: 600; }
.status-chip { padding: 5px 10px; border-radius: 7px; font-size: 13px; font-weight: 600; background: #23272e; color: var(--text-3); }
.status-chip.tone-green { background: rgba(46, 189, 133, .14); color: var(--green); }
.status-chip.tone-blue { background: rgba(91, 141, 255, .14); color: #8eacff; }
.status-chip.tone-amber { background: rgba(240, 185, 11, .14); color: var(--brand); }
.flow-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-3); }
.flow-meta span { display: inline-flex; align-items: center; gap: 5px; }
.flow-meta .next-run { color: var(--green); font-variant-numeric: tabular-nums; }

.phase-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 18px 12px; border-bottom: 1px solid var(--line); }
.phase-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.phase-bar li {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 12px; border-radius: 8px;
  border: 1px solid transparent; background: #23272e;
  font-size: 13.5px; color: var(--text-3);
  transition: all .25s;
}
.phase-num { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #3a404a; font-size: 11px; font-weight: 700; color: var(--text-2); }
.phase-bar li.current { border-color: rgba(240, 185, 11, .55); background: rgba(240, 185, 11, .08); color: var(--brand); }
.phase-bar li.current .phase-num { background: var(--brand); color: #181a20; }
.phase-bar li.done { color: var(--text-2); }
.phase-bar li.done .phase-num { background: var(--green); color: #0e1a14; font-size: 0; }
.phase-bar li.done .phase-num::after { content: "✓"; font-size: 11px; }
.phase-bar li.live { border-color: rgba(46, 189, 133, .5); background: rgba(46, 189, 133, .1); color: var(--green); }
.phase-bar li.live .phase-num { background: var(--green); color: #0e1a14; animation: live 1.8s infinite; }
.next-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 8px;
  background: var(--yellow); color: #181a20; font-size: 14px; font-weight: 600;
  transition: background .15s, opacity .15s;
}
.next-btn:hover:not(:disabled) { background: var(--yellow-hover); }
.next-btn:disabled { opacity: .5; }
.next-btn.ghost { background: #2b3139; color: var(--text); }
.next-btn.ghost:hover { background: #353b45; }

.test-panel { margin: 12px 18px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: #15181d; animation: msg-in .3s ease-out; }
.tp-head { display: flex; align-items: center; gap: 10px; }
.tp-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; }
.tp-agent { margin-left: auto; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-3); }
.tp-state { padding: 2px 6px; border-radius: 4px; background: rgba(240, 185, 11, .14); color: var(--brand); font-weight: 600; }
.tp-state.ok { background: rgba(46, 189, 133, .14); color: var(--green); }
.tp-state.bad { background: rgba(246, 70, 93, .14); color: var(--red); }
.tp-x { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; color: var(--text-3); }
.tp-x:hover { background: rgba(255, 255, 255, .06); }
.tp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.tp-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px; border-radius: 9px; text-align: left;
  border: 1px solid var(--line); background: #1b1f25;
  transition: border-color .2s, background .2s;
}
.tp-card.selected { border-color: #4a505a; }
.tp-card.is-running { border-color: rgba(240, 185, 11, .55); background: rgba(240, 185, 11, .05); }
.tp-card.is-passed { border-color: rgba(46, 189, 133, .4); }
.tp-card.is-failed { border-color: rgba(246, 70, 93, .55); }
.tp-name { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.tp-card.is-pending .tp-name { color: var(--text-4); }
.tp-bar { height: 3px; border-radius: 2px; background: #2b3139; overflow: hidden; }
.tp-bar i { display: block; width: 0; height: 100%; border-radius: 2px; background: var(--brand); transition: width .25s ease-out; }
.tp-card.is-passed .tp-bar i { background: var(--green); }
.tp-card.is-failed .tp-bar i { background: var(--red); }
.tp-count { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tp-cases { max-height: 104px; margin: 10px 0 0; padding: 0; overflow-y: auto; list-style: none; }
.tp-cases li { display: flex; align-items: baseline; gap: 6px; padding: 3px 2px; font-size: 12.5px; color: var(--text-2); animation: msg-in .2s ease-out; }
.tp-cases li .icon { position: relative; top: 3px; }
.tp-cases li.ok .icon { color: var(--green); }
.tp-cases li.bad { color: #ffb3bf; }
.tp-cases li.bad .icon { color: var(--red); }
.tp-cases small { color: var(--text-4); }
.test-panel.collapsed { padding: 8px 12px; }
.test-panel.collapsed .tp-cases, .test-panel.collapsed .tp-foot > span:first-child { display: none; }
.test-panel.collapsed .tp-grid { margin-top: 8px; }
.test-panel.collapsed .tp-card { flex-direction: row; align-items: center; padding: 6px 10px; }
.test-panel.collapsed .tp-bar { flex: 1; }
.test-panel.collapsed .tp-foot { margin-top: 6px; padding-top: 6px; }
.tp-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-4); }
.tp-dry { color: var(--text-3); }
.tp-dry b.success { color: var(--green); }
.tp-dry b.running { color: var(--brand); }
.tp-dry b.error { color: var(--red); }

.flow-body { position: relative; flex: 1; min-height: 0; margin: 12px 18px 18px; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; background: #0f1115; }
.flow-tabs { position: absolute; top: 12px; left: 12px; z-index: 6; display: flex; gap: 2px; padding: 3px; border-radius: 9px; background: #1d2127; border: 1px solid var(--line); }
.flow-tab { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 7px; font-size: 13px; color: var(--text-3); }
.flow-tab.active { background: #2b3139; color: var(--text); }
.flow-tab:hover:not(.active) { color: var(--text-2); }

.code-view {
  position: absolute; inset: 0; margin: 0; padding: 62px 22px 22px; overflow: auto;
  font: 12.5px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace; color: #c9d1d9; white-space: pre;
}
.c-com { color: #6a7585; }
.c-str { color: #f0c674; }
.c-kw { color: #c792ea; }

.runs-view { position: absolute; inset: 0; padding: 62px 22px 22px; overflow: auto; }
.runs-view h4, .modal-card h4 { margin: 18px 0 8px; font-size: 13px; color: var(--text-2); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: #1b1f25; border: 1px solid var(--line); }
.stat span { font-size: 12px; color: var(--text-3); }
.stat b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat small { font-size: 12px; color: var(--text-3); font-weight: 400; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { padding: 6px 8px; font-size: 12px; font-weight: 500; color: var(--text-3); text-align: left; border-bottom: 1px solid var(--line); }
.data-table td { padding: 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.data-table td small { display: block; font-size: 11px; color: var(--text-4); }
.table-wrap { max-height: 280px; overflow: auto; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; background: #2b3139; font-size: 12px; color: var(--text-2); }
.tag.green { background: rgba(46, 189, 133, .14); color: var(--green); }
.run-list { margin: 0; padding: 0; list-style: none; }
.run-list li { display: flex; align-items: baseline; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.run-list .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.run-list li.error .dot { background: var(--red); }
.run-list li.unread em { color: var(--text); }
.run-list span { color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.run-list em { font-style: normal; color: var(--text-2); }
.empty { padding: 12px 0; font-size: 13px; color: var(--text-4); }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity .18s; }
.modal.open .modal-backdrop { opacity: 1; }
.modal-card {
  position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 20px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  opacity: 0; transform: translateY(10px) scale(.98); transition: opacity .18s, transform .18s;
}
.modal-card.wide { width: min(760px, 100%); }
.modal.open .modal-card { opacity: 1; transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head b { font-size: 17px; }
.modal-sub { margin: 6px 0 16px; font-size: 13px; line-height: 1.6; color: var(--text-3); }
.modal-error { margin-top: 12px; padding: 8px 10px; border-radius: 8px; background: rgba(246, 70, 93, .12); color: #ffb3bf; font-size: 13px; }
.wallet-list { display: flex; flex-direction: column; gap: 8px; }
.wallet-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 12px; text-align: left;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .02);
  transition: border-color .15s, background .15s;
}
.wallet-item:hover:not(:disabled) { border-color: var(--brand); background: rgba(240, 185, 11, .05); }
.wallet-item:disabled { opacity: .5; }
.wallet-item.loading { opacity: 1; border-color: var(--brand); }
.wallet-item img, .wallet-fallback { width: 36px; height: 36px; border-radius: 10px; }
.wallet-fallback { display: grid; place-items: center; background: #2b3139; color: var(--brand); }
.wallet-item > span:not(.wallet-fallback) { flex: 1; display: flex; flex-direction: column; }
.wallet-item small { font-size: 12px; color: var(--text-4); }
.wallet-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; border-radius: 12px; background: rgba(240, 185, 11, .06); text-align: center; color: var(--text-2); font-size: 13px; }
.wallet-empty > .icon { color: var(--brand); width: 28px; height: 28px; }
.wallet-links { display: flex; gap: 12px; }
.wallet-links a { color: var(--brand); text-decoration: underline; }
.login-steps { display: flex; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; counter-reset: s; }
.login-steps li { flex: 1; padding: 8px 4px; border-radius: 8px; background: #23272e; text-align: center; font-size: 12px; color: var(--text-4); counter-increment: s; }
.login-steps li::before { content: counter(s) " · "; }
.login-steps li.current { background: rgba(240, 185, 11, .12); color: var(--brand); }
.login-steps li.done { background: rgba(46, 189, 133, .12); color: var(--green); }
.market-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.market-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-height: min(560px, calc(100vh - 220px)); overflow-y: auto; }
.market-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border-radius: 12px; background: #1b1f25; border: 1px solid var(--line); transition: border-color .15s; }
.market-card:hover { border-color: #4a505a; }
.market-card p { flex: 1; font-size: 13px; line-height: 1.6; color: var(--text-3); }
.mc-top { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.mc-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.mc-meta span { padding: 1px 6px; border-radius: 4px; background: #23272e; font-size: 11px; color: var(--text-3); }
.tag.blue { background: rgba(91, 141, 255, .14); color: #8eacff; }
.tag.amber { background: rgba(240, 185, 11, .14); color: var(--brand); }
.tag.red { background: rgba(246, 70, 93, .14); color: #ff9aa9; }

/* ---------- 能力目录抽屉 ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  display: flex; flex-direction: column;
  width: min(400px, 100vw); background: #181b21; border-left: 1px solid var(--line-strong);
  box-shadow: -20px 0 50px rgba(0, 0, 0, .45);
  transform: translateX(100%); transition: transform .22s ease;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 16px 12px; }
.drawer-head b { display: block; font-size: 16px; }
.drawer-head span { font-size: 12px; color: var(--text-3); }
.drawer-search { display: flex; align-items: center; gap: 8px; margin: 0 16px; padding: 0 12px; height: 38px; border-radius: 10px; border: 1px solid var(--line-strong); color: var(--text-3); }
.drawer-search:focus-within { border-color: #4a505a; }
.drawer-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
.drawer-cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; }
.dc { height: 28px; padding: 0 10px; border-radius: 14px; background: #23272e; font-size: 12.5px; color: var(--text-3); }
.dc.active { background: rgba(240, 185, 11, .14); color: var(--brand); }
.drawer-list { flex: 1; overflow-y: auto; padding: 0 12px 16px; }
.cap { display: flex; align-items: flex-start; gap: 10px; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.cap-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--cat-bg, #23272e); color: var(--cat, var(--text-2)); }
.cap-body { flex: 1; min-width: 0; }
.cap-body b { font-size: 14px; }
.cap-body p { margin: 2px 0 6px; font-size: 12.5px; line-height: 1.55; color: var(--text-3); }
.cap-src { display: inline-block; padding: 0 6px; border-radius: 4px; background: #23272e; font-size: 11px; color: var(--text-3); }
.cap-src.binance { background: rgba(240, 185, 11, .12); color: var(--brand); }
.cap-src.gmgn { background: rgba(46, 189, 133, .12); color: var(--green); }
.cap-add { flex: none; height: 28px; padding: 0 12px; border-radius: 7px; background: #2b3139; font-size: 12.5px; font-weight: 600; }
.cap-add:hover { background: var(--yellow); color: #181a20; }

@media (max-width: 1100px) {
  .tp-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .view-workspace .workspace { flex-direction: column; overflow-y: auto; }
  .view-workspace .chat-col { width: 100%; height: 55vh; flex: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .view-workspace .flow-col { min-height: 640px; }
}
@media (max-width: 768px) {
  .pulse-grid, .market-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .chat-inner { padding: 16px 16px 8px; }
  .chat-dock { padding: 8px 12px 12px; }
  .flow-body { margin: 10px; }
}

/* ---------- 补充：指令菜单、作废卡片、小按钮、版本提示 ---------- */
.chips { position: relative; }
.cmd-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  width: 300px; padding: 6px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5); animation: pop .14s ease-out;
}
.cmd-item { display: flex; flex-direction: column; width: 100%; padding: 8px 10px; border-radius: 8px; text-align: left; }
.cmd-item:hover { background: rgba(255, 255, 255, .06); }
.cmd-item b { font-size: 13.5px; color: var(--brand); }
.cmd-item small { font-size: 12px; color: var(--text-3); }
.stale-note { display: inline-block; margin-bottom: 8px; padding: 2px 8px; border-radius: 6px; background: #2b3139; font-size: 12px; color: var(--text-3); }
.mini-btn { height: 22px; margin-left: 4px; padding: 0 8px; border-radius: 5px; background: #2b3139; font-size: 12px; color: var(--text-2); }
.mini-btn:hover:not(:disabled) { background: var(--yellow); color: #181a20; }
.tp-stale { padding: 2px 6px; border-radius: 4px; background: rgba(240, 185, 11, .12); font-size: 11.5px; color: var(--brand); }
.pulse-row .win { margin-left: 4px; font-style: normal; font-size: 10px; color: var(--text-4); }
.run-list.versions b { color: var(--brand); white-space: nowrap; }
@media (max-width: 900px) {
  .wf-viewport { touch-action: pan-y; }
}
/* 分页列表 */
.runs-view h4 small, .modal-card h4 small { margin-left: 6px; font-weight: 400; font-size: 11.5px; color: var(--text-4); }
.more-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 32px; margin-top: 6px;
  border-radius: 8px; border: 1px dashed var(--line-strong); font-size: 12.5px; color: var(--text-2);
}
.more-btn small { font-size: 11.5px; color: var(--text-4); }
.more-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.more-btn.loading { opacity: .6; cursor: progress; }
/* 测试面板：窄屏下卡片可收缩，不再撑出边框 */
.tp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tp-card { min-width: 0; }
.tp-name { text-overflow: ellipsis; }
.tp-title { white-space: nowrap; }
.tp-head { flex-wrap: wrap; row-gap: 4px; }
@media (max-width: 1100px) {
  .tp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* 变更对照表：长参数值（如自选列表）可换行，标签列保留宽度 */
.diff-table td:first-child { width: 38%; min-width: 6.5em; }
.diff-table td:not(:first-child) { white-space: normal; overflow-wrap: anywhere; }
/* 窄屏：测试面板展开时画布也保留足够高度（整列随之变长，页面纵向滚动） */
@media (max-width: 900px) {
  .view-workspace .flow-body { flex: none; height: max(520px, 72vh); }
}
/* 代币标签：点击复制合约地址 */
.tk {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; height: 22px; padding: 0 7px;
  border-radius: 6px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .03);
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); vertical-align: middle; cursor: copy;
  transition: border-color .15s, background .15s, color .15s;
}
.tk span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 12em; }
.tk em { font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.tk .tk-ic { flex: none; width: 12px; height: 12px; color: var(--text-4); }
.tk:hover { border-color: rgba(240, 185, 11, .6); background: rgba(240, 185, 11, .08); }
.tk:hover .tk-ic { color: var(--brand); }
.tk.copied { border-color: rgba(46, 189, 133, .7); background: rgba(46, 189, 133, .12); }
.tk.copied .tk-ic { color: var(--green); }
.tk-row { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; vertical-align: middle; }
.msg-event .tk-row, .run-list .tk-row { margin: 4px 0 0; display: flex; }
.data-table td .tk { margin-bottom: 2px; }
.pulse-row { cursor: copy; }
.pulse-row:hover b { color: var(--brand); }
