/* ============================================================
 * styles.css —— 博弈推演工作台（深色企业工作台风格）
 * 零依赖：仅系统字体、纯 CSS 视觉（渐变/网格/卡片/徽章）
 * ============================================================ */

:root {
  --bg: #080b11;
  --bg-2: #0f141c;
  --surface: #141b26;
  --surface-2: #1a2330;
  --surface-3: #202b3a;
  --line: #263240;
  --line-2: #34435a;

  --text: #e9eff7;
  --muted: #93a2b8;
  --muted-2: #6b7a90;

  --accent: #5aa9ff;
  --accent-soft: rgba(90, 169, 255, 0.15);
  --ok: #3ddc97;
  --warn: #ffc857;
  --danger: #ff7a66;
  --purple: #c58cff;
  --cyan: #5fe3e3;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(0, 0, 0, 0.28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 82% -14%, rgba(90, 169, 255, 0.1), transparent 62%),
    radial-gradient(900px 520px at 8% 4%, rgba(197, 140, 255, 0.07), transparent 58%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent);
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::selection {
  background: rgba(90, 169, 255, 0.3);
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border: 2px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--line-2);
  background-clip: content-box;
}

/* ============================================================
 * 顶栏
 * ============================================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 24px;
  background: rgba(12, 17, 24, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #08101c;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 18px rgba(90, 169, 255, 0.28);
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--muted-2);
}

.topbar-spacer {
  flex: 1 1 auto;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.topbar-meta b {
  color: var(--text);
  font-weight: 600;
  font-family: var(--mono);
  font-size: 11.5px;
}

/* ============================================================
 * 状态徽标 / 横幅
 * ============================================================ */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.status-badge .dot.live {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.16);
  animation: pulse 1.8s infinite;
}

.status-badge .dot.demo {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(255, 200, 87, 0.16);
}

.status-badge .dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 122, 102, 0.16);
}

.status-badge.is-live {
  border-color: rgba(61, 220, 151, 0.35);
  color: #d6fbe9;
}

.status-badge.is-demo {
  border-color: rgba(255, 200, 87, 0.35);
  color: #fff0cc;
}

.status-badge.is-error {
  border-color: rgba(255, 122, 102, 0.35);
  color: #ffdcd5;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.32;
  }
}

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.banner[hidden] {
  display: none !important;
}

.banner-demo {
  background: linear-gradient(90deg, rgba(255, 200, 87, 0.16), rgba(255, 200, 87, 0.04));
  border-bottom-color: rgba(255, 200, 87, 0.3);
  color: #ffe9b8;
}

.banner-error {
  background: linear-gradient(90deg, rgba(255, 122, 102, 0.16), rgba(255, 122, 102, 0.04));
  border-bottom-color: rgba(255, 122, 102, 0.3);
  color: #ffd8d0;
}

.banner strong {
  font-weight: 700;
}

.banner .banner-icon {
  font-size: 15px;
}

.banner-spacer {
  flex: 1 1 auto;
}

/* ============================================================
 * 布局
 * ============================================================ */

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 372px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  max-width: 1680px;
  margin: 0 auto;
  padding: 20px 24px 56px;
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.col-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* ============================================================
 * 卡片
 * ============================================================ */

.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.014);
}

.card-head h2,
.card-head h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.card-head .sub {
  font-size: 12px;
  color: var(--muted-2);
}

.card-head .spacer {
  flex: 1 1 auto;
}

.card-body {
  padding: 18px;
}

.card-foot {
  padding: 12px 18px 16px;
  font-size: 12px;
  color: var(--muted-2);
  border-top: 1px solid var(--line);
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 6px 2px -6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--muted-2);
  text-transform: uppercase;
}

/* ============================================================
 * 指标摘要
 * ============================================================ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
}

.stat-label {
  font-size: 11.5px;
  color: var(--muted-2);
  letter-spacing: 0.6px;
}

.stat-value {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat-value small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}

.stat-note {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted-2);
}

/* ============================================================
 * 表单
 * ============================================================ */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.field .hint {
  font-size: 11.5px;
  color: var(--muted-2);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 12px;
}

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  resize: vertical;
  min-height: 92px;
  line-height: 1.6;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* ============================================================
 * 按钮
 * ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.06s, opacity 0.15s;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--line-2);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #3f7fd6);
  border-color: transparent;
  color: #06121f;
  box-shadow: 0 6px 18px rgba(90, 169, 255, 0.24);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #7cbcff, var(--accent));
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12.5px;
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-row .btn {
  flex: 1 1 auto;
}

/* ============================================================
 * 洞察 / 场景列表
 * ============================================================ */

.list-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted-2);
}

.list-scroll {
  max-height: 268px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.insight-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.12s;
}

.insight-item:last-child {
  border-bottom: none;
}

.insight-item:hover {
  background: rgba(255, 255, 255, 0.028);
}

.insight-item.is-selected {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.insight-item input[type="checkbox"] {
  margin-top: 3px;
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  flex: 0 0 auto;
}

.insight-main {
  min-width: 0;
  flex: 1 1 auto;
}

.insight-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.insight-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted-2);
}

.tag-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  white-space: nowrap;
}

.tag-accent {
  border-color: rgba(90, 169, 255, 0.35);
  background: var(--accent-soft);
  color: #cfe6ff;
}

.tag-warn {
  border-color: rgba(255, 200, 87, 0.35);
  background: rgba(255, 200, 87, 0.12);
  color: #ffe6b0;
}

.tag-ok {
  border-color: rgba(61, 220, 151, 0.35);
  background: rgba(61, 220, 151, 0.12);
  color: #c6f7e0;
}

.tag-danger {
  border-color: rgba(255, 122, 102, 0.35);
  background: rgba(255, 122, 102, 0.12);
  color: #ffd6cf;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.chip:hover {
  color: var(--text);
  border-color: var(--accent);
}

.chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #d8ecff;
  font-weight: 600;
}

/* ============================================================
 * 进度
 * ============================================================ */

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-track {
  position: relative;
  flex: 1 1 auto;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  transition: width 0.35s ease;
}

.progress-fill.is-done {
  background: linear-gradient(90deg, var(--ok), var(--cyan));
}

.progress-fill.is-error {
  background: linear-gradient(90deg, var(--danger), var(--warn));
}

.progress-value {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  min-width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
 * 群落散点
 * ============================================================ */

.viz-canvas-wrap {
  position: relative;
  width: 100%;
  height: 372px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 50%, rgba(90, 169, 255, 0.05), transparent 68%),
    var(--bg-2);
  overflow: hidden;
}

#agent-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.agent-tip {
  position: absolute;
  z-index: 5;
  max-width: 268px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: rgba(14, 20, 28, 0.97);
  box-shadow: var(--shadow);
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}

.agent-tip.is-visible {
  opacity: 1;
}

.agent-tip .tip-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 5px;
}

.agent-tip dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  margin: 0;
}

.agent-tip dt {
  color: var(--muted-2);
}

.agent-tip dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  text-align: right;
}

.legend {
  display: flex;
  gap: 8px 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.legend-bar {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  flex: 0 0 auto;
}

/* ============================================================
 * 图表
 * ============================================================ */

.chart-wrap {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 10px 12px 4px;
}

.chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 140px;
  color: var(--muted-2);
  font-size: 12.5px;
}

.grid-line {
  stroke: #1e2836;
  stroke-width: 1;
}

.grid-line.zero {
  stroke: #33445c;
}

.axis-text {
  fill: #6b7a90;
  font-size: 10px;
  font-family: var(--mono);
}

.axis-title {
  fill: #7c8ca3;
  font-size: 10px;
  letter-spacing: 0.6px;
}

.axis-line {
  stroke: #2b3a4d;
  stroke-width: 1;
}

.series-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.series-dot {
  stroke: var(--bg-2);
  stroke-width: 2;
}

.bar-label {
  fill: #93a2b8;
  font-size: 10.5px;
  font-family: var(--mono);
}

.node-label {
  fill: #cdd9e8;
  font-size: 11px;
  font-weight: 600;
}

.node-sub {
  fill: #93a2b8;
  font-size: 10px;
  font-family: var(--mono);
}

.ring {
  fill: none;
  stroke-dasharray: 3 4;
  opacity: 0.5;
}

/* ============================================================
 * 时间线
 * ============================================================ */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.round {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
}

.round-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 14px;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.016);
}

.round-head:hover {
  background: rgba(255, 255, 255, 0.032);
}

.round-no {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent-soft);
  border: 1px solid rgba(90, 169, 255, 0.3);
  color: #cfe6ff;
  font-weight: 700;
  font-size: 12.5px;
  flex: 0 0 auto;
}

.round-title {
  font-size: 13px;
  font-weight: 600;
}

.round-summary {
  font-size: 11.5px;
  color: var(--muted-2);
}

.round-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}

.round-block {
  margin-top: 12px;
}

.block-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--muted-2);
  text-transform: uppercase;
}

.event-item {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 6px;
  font-size: 12.5px;
}

.event-item .event-body {
  flex: 1 1 auto;
  min-width: 0;
}

.event-item .event-meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted-2);
}

.act-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}

.act-item:last-child {
  border-bottom: none;
}

.act-main {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.act-agent {
  font-weight: 600;
  color: var(--text);
}

.act-arrow {
  color: var(--muted-2);
}

.act-action {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid currentColor;
}

.act-intensity {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  white-space: nowrap;
}

.act-reason {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
  padding-left: 2px;
}

.act-list {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

details.collapse > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

details.collapse > summary::-webkit-details-marker {
  display: none;
}

details.collapse > summary::before {
  content: "▸";
  color: var(--muted-2);
  transition: transform 0.15s;
}

details.collapse[open] > summary::before {
  transform: rotate(90deg);
}

details.collapse > summary:hover {
  color: var(--text);
}

.highlight-list li {
  position: relative;
  padding: 5px 0 5px 16px;
  font-size: 12.5px;
  color: #dbe6f3;
}

.highlight-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.market-mini {
  display: flex;
  gap: 6px 14px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted-2);
}

.market-mini b {
  color: var(--text);
  font-family: var(--mono);
  font-weight: 600;
}

/* 实时流 */
.live-log {
  max-height: 236px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.75;
}

.log-line {
  display: flex;
  gap: 9px;
  align-items: baseline;
}

.log-time {
  color: var(--muted-2);
  flex: 0 0 auto;
}

.log-tag {
  flex: 0 0 auto;
  color: var(--cyan);
}

.log-tag.is-error {
  color: var(--danger);
}

.log-text {
  color: var(--muted);
  word-break: break-word;
}

/* ============================================================
 * 路径卡片
 * ============================================================ */

.path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(288px, 1fr));
  gap: 14px;
}

.path-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(170deg, var(--surface-2), var(--bg-2));
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
  overflow: hidden;
}

.path-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--cluster-color, var(--accent));
}

.path-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  box-shadow: var(--shadow);
}

.path-card.is-active {
  border-color: var(--cluster-color, var(--accent));
  box-shadow: 0 0 0 1px var(--cluster-color, var(--accent)), var(--shadow);
}

.path-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.path-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  padding: 1px 7px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
}

.path-label {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.path-prob {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.path-prob-value {
  font-size: 25px;
  font-weight: 700;
  color: var(--cluster-color, var(--accent));
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.path-prob-track {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.path-prob-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--cluster-color, var(--accent));
}

.path-narrative {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.62;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.path-names {
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.6;
}

.path-names .who {
  color: #cdd9e8;
}

.path-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted-2);
}

/* 分布条 */
.dist-bar {
  display: flex;
  width: 100%;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-3);
}

.dist-seg {
  height: 100%;
  transition: filter 0.15s;
  position: relative;
}

.dist-seg:hover {
  filter: brightness(1.25);
}

.dist-legend {
  display: flex;
  gap: 8px 18px;
  flex-wrap: wrap;
  margin-top: 13px;
  font-size: 12px;
}

.dist-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.dist-legend-item b {
  color: var(--text);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* 分叉点 */
.turn-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.turn-item {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.turn-round {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: #cfe6ff;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--accent-soft);
  border: 1px solid rgba(90, 169, 255, 0.3);
  text-align: center;
  white-space: nowrap;
}

.turn-body {
  min-width: 0;
}

.turn-desc {
  font-size: 12.5px;
  color: #dbe6f3;
}

.turn-drivers {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted-2);
}

.turn-entropy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 92px;
}

.entropy-value {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.entropy-track {
  width: 88px;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.entropy-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--warn));
}

.entropy-caption {
  font-size: 10.5px;
  color: var(--muted-2);
}

/* ============================================================
 * 汇总
 * ============================================================ */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.summary-box {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.summary-box.span-2 {
  grid-column: 1 / -1;
}

.summary-box h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.summary-box h4 .ico {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 11px;
  background: var(--surface-3);
}

.summary-list li {
  position: relative;
  padding: 5px 0 5px 15px;
  font-size: 12.5px;
  color: #d5e0ee;
  line-height: 1.6;
}

.summary-list li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 1.5px;
  background: var(--muted-2);
}

.summary-box.drivers .summary-list li::before {
  background: var(--accent);
}
.summary-box.risks .summary-list li::before {
  background: var(--danger);
}
.summary-box.opportunities .summary-list li::before {
  background: var(--ok);
}

.recommendation {
  font-size: 13.5px;
  line-height: 1.75;
  color: #e8f0fa;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(90, 169, 255, 0.28);
  background: linear-gradient(135deg, rgba(90, 169, 255, 0.1), transparent);
}

.confidence-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.confidence-track {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--ok));
}

.confidence-value {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
}

/* 行动分布 */
.actdist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.actdist-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 52px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.actdist-track {
  height: 9px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.actdist-fill {
  height: 100%;
  border-radius: 999px;
}

.actdist-count {
  text-align: right;
  font-family: var(--mono);
  color: var(--muted);
}

/* ============================================================
 * 下钻抽屉
 * ============================================================ */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(4, 7, 11, 0.66);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.2s;
}

.drawer-backdrop.is-open {
  opacity: 1;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  width: min(620px, 94vw);
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border-left: 1px solid var(--line-2);
  box-shadow: -18px 0 48px rgba(0, 0, 0, 0.5);
  transform: translateX(102%);
  transition: transform 0.26s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.drawer-head .spacer {
  flex: 1 1 auto;
}

.drawer-title {
  font-size: 15px;
  font-weight: 700;
}

.drawer-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted-2);
}

.drawer-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 16px 18px 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
}

.kv {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.kv .k {
  font-size: 11px;
  color: var(--muted-2);
}

.kv .v {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.person-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px dashed var(--line);
}

.person-list li:last-child {
  border-bottom: none;
}

.person-list .k {
  color: var(--muted-2);
}

.person-list .v {
  font-family: var(--mono);
}

/* ============================================================
 * 提示条 / 空状态
 * ============================================================ */

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(20, 27, 38, 0.97);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  max-width: 84vw;
  animation: toast-in 0.2s ease;
}

.toast.is-error {
  border-color: rgba(255, 122, 102, 0.5);
  color: #ffd8d0;
}

.toast.is-ok {
  border-color: rgba(61, 220, 151, 0.5);
  color: #c9f8e2;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 120px;
  padding: 22px;
  text-align: center;
  color: var(--muted-2);
  font-size: 12.5px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.empty .empty-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted-2);
}

/* ============================================================
 * 视图切换 / 图谱视图（能力扩展①，契约见 docs/03 第 1 节）
 *
 * 注意 .view-pane[hidden] 与 .grow-banner[hidden] 必须显式 display:none：
 * 下面的 .view-pane 用了 display:flex，类选择器会盖掉 UA 的 [hidden]{display:none}，
 * 不加这两条就会出现"切走了还占着版面"的经典 bug。
 * ============================================================ */

.view-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.view-tab {
  padding: 7px 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.view-tab:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-3);
}

.view-tab.is-active {
  background: var(--accent-soft);
  color: #d7ebff;
  box-shadow: inset 0 0 0 1px rgba(90, 169, 255, 0.34);
}

.view-tab.is-disabled,
.view-tab:disabled {
  color: var(--muted-2);
  cursor: not-allowed;
  opacity: 0.5;
  text-decoration: line-through;
}

.view-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.view-pane[hidden] {
  display: none !important;
}

.graph-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1180px) {
  .graph-stage {
    grid-template-columns: minmax(0, 1fr);
  }
}

.graph-canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0) 0 0 / 22px 22px,
    var(--bg-2);
  overflow: hidden;
}

.graph-canvas-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.graph-canvas-wrap svg:active {
  cursor: grabbing;
}

.graph-tip {
  position: absolute;
  z-index: 5;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: rgba(16, 22, 31, 0.97);
  box-shadow: var(--shadow-sm);
  font-size: 11.5px;
  line-height: 1.55;
  pointer-events: none;
}

.graph-tip[hidden] {
  display: none !important;
}

.graph-hintbar {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 4;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(12, 17, 24, 0.86);
  color: var(--muted-2);
  font-size: 11px;
  pointer-events: none;
}

.graph-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ctrl-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--muted);
}

.focus-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.focus-row select {
  flex: 1 1 120px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.ctrl-sliders {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.slider-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  font-size: 11.5px;
  color: var(--muted);
}

.slider-row input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--accent);
}

.ctrl-value {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text);
  text-align: right;
}

.graph-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.graph-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 640px;
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.grow-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid rgba(61, 220, 151, 0.36);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(61, 220, 151, 0.12), transparent);
  color: #cdf6e4;
  font-size: 12.5px;
}

.grow-banner[hidden] {
  display: none !important;
}

.grow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.6);
  animation: grow-pulse 1.6s ease-out 2;
}

@keyframes grow-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.6);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(61, 220, 151, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(61, 220, 151, 0);
  }
}

/* 双栏（渲染层未实现，占位布局保留以便后续接手） */
.dual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.dual-left,
.col-side {
  min-width: 0;
}

@media (max-width: 1180px) {
  .dual-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.btn-demo-live {
  font-size: 11.5px;
}

/* ============================================================
 * MIROFISH 式视图层：Step 条 / 双栏 / 工作台 / 控制台
 * ============================================================ */

/* ---------- Step N/5 ---------- */
.step-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.step-count {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.step-stage {
  font-size: 12px;
  font-weight: 600;
  color: #d7ebff;
  white-space: nowrap;
}

.step-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.step-dot {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: transparent;
  color: var(--muted-2);
  font: inherit;
  font-size: 10.5px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.step-dot:hover {
  border-color: var(--accent);
  color: var(--text);
}

.step-dot.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #06101c;
  font-weight: 700;
}

.step-dot.is-done {
  border-color: rgba(61, 220, 151, 0.5);
  color: var(--ok);
}

/* ---------- 双栏 ---------- */
.dual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.dual-grid.is-left-open {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.dual-grid:not(.is-left-open) {
  grid-template-columns: 0 minmax(0, 1fr);
}

.dual-grid:not(.is-left-open) .dual-left {
  display: none;
}

.dual-right {
  min-width: 0;
}

@media (max-width: 1180px) {
  .dual-grid,
  .dual-grid.is-left-open {
    grid-template-columns: minmax(0, 1fr);
  }
  .dual-grid:not(.is-left-open) .dual-left {
    display: none;
  }
}

.graph-canvas-wrap.is-compact {
  min-height: 300px;
}

.graph-legend.is-compact {
  gap: 4px;
  margin-top: 8px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.switch input {
  accent-color: var(--accent);
}

/* ---------- 推演流 ---------- */
.stream {
  display: flex;
  flex-direction: column;
  gap: 11px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.stream-round {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.stream-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 600;
  color: #dbe6f3;
  margin-bottom: 6px;
}

.stream-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(90, 169, 255, 0.3);
  color: #cfe6ff;
}

.stream-env {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
}

.stream-event {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-size: 11.5px;
  border-top: 1px dashed var(--line);
}

.stream-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--muted);
}

.stream-event-title {
  flex: 1 1 auto;
  color: #cfdcec;
}

.stream-action {
  display: grid;
  grid-template-columns: 118px auto 34px minmax(0, 1fr);
  gap: 7px;
  align-items: baseline;
  padding: 4px 0;
  font-size: 11.5px;
}

.stream-agent {
  color: #dbe6f3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-reason {
  color: var(--muted);
  line-height: 1.5;
}

.stream-memory {
  display: flex;
  gap: 7px;
  align-items: baseline;
  margin: 2px 0 2px 118px;
  padding: 4px 8px;
  border-left: 2px solid rgba(197, 140, 255, 0.5);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(197, 140, 255, 0.07);
  font-size: 11px;
  color: #cdd9e8;
}

.stream-memory-text {
  flex: 1 1 auto;
  color: var(--muted);
}

.stream-highlight {
  margin-top: 4px;
  padding-left: 11px;
  border-left: 2px solid var(--warn);
  font-size: 11.5px;
  color: #f0dfb8;
}

.stream-reflection {
  padding: 10px 13px;
  border: 1px solid rgba(197, 140, 255, 0.36);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(197, 140, 255, 0.12), transparent);
}

.stream-reflection-text {
  font-size: 12.5px;
  color: #e6d9ff;
  line-height: 1.6;
}

/* ---------- 工作台 ---------- */
.workbench-grid {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr) 336px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1500px) {
  .workbench-grid {
    grid-template-columns: 216px minmax(0, 1fr);
  }
  .wb-side {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
  }
}

.wb-agents,
.wb-profile {
  min-width: 0;
}

.wb-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.wb-agent-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 560px;
  overflow: auto;
}

.wb-group {
  margin: 9px 0 3px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--muted-2);
}

.wb-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 2px 8px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.wb-item:hover {
  background: var(--surface-3);
}

.wb-item.is-active {
  border-color: rgba(90, 169, 255, 0.4);
  background: var(--accent-soft);
}

.wb-item-id {
  font-size: 11px;
  color: var(--muted-2);
}

.wb-item-name {
  font-size: 12px;
  color: #e2ebf6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-item-meta {
  grid-column: 2;
  font-size: 10.5px;
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-profile-body {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

/* ---------- 通用面板（mf-*） ---------- */
.chip.tiny {
  padding: 1px 7px;
  font-size: 10.5px;
}

.mf-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.mf-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.mf-panel {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.mf-panel h4 {
  margin: 2px 0 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--muted);
}

.mf-bar {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
  padding: 2px 0;
  font-size: 11px;
}

.mf-bar-label {
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mf-bar-track {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.mf-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}

.mf-bar-value {
  text-align: right;
  color: var(--muted);
  font-size: 10.5px;
}

.mf-grid-3 .mf-spark-cell,
.mf-spark-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.mf-spark-label {
  font-size: 10.5px;
  color: var(--muted-2);
}

.mf-spark {
  width: 100%;
  height: 42px;
}

.mf-spark-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.mf-spark-value {
  font-size: 12px;
  color: #e2ebf6;
}

.mf-note {
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.mf-note.is-warn {
  border-color: rgba(255, 200, 87, 0.42);
  background: linear-gradient(135deg, rgba(255, 200, 87, 0.1), transparent);
}

.mf-note-head {
  font-size: 11.5px;
  font-weight: 700;
  color: #dbe6f3;
  margin-bottom: 4px;
}

.mf-note-body {
  font-size: 12px;
  color: #cfdcec;
  line-height: 1.6;
}

.mf-note-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted-2);
  line-height: 1.55;
}

.mf-decision {
  display: grid;
  grid-template-columns: 34px auto 36px minmax(0, 1fr);
  gap: 7px;
  align-items: baseline;
  padding: 4px 0;
  font-size: 11.5px;
  border-bottom: 1px dashed var(--line);
}

.mf-decision:last-child {
  border-bottom: none;
}

.mf-decision-reason {
  color: var(--muted);
  line-height: 1.5;
}

.mf-memory {
  display: grid;
  grid-template-columns: 52px auto 34px 32px minmax(0, 1fr);
  gap: 6px;
  align-items: baseline;
  padding: 5px 7px;
  border-left: 2px solid var(--line-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 11px;
  transition: background 0.3s;
}

.mf-memory.is-observation {
  border-left-color: var(--cyan);
}
.mf-memory.is-action {
  border-left-color: var(--accent);
}
.mf-memory.is-outcome {
  border-left-color: var(--ok);
}
.mf-memory.is-reflection {
  border-left-color: var(--purple);
  background: rgba(197, 140, 255, 0.07);
}
.mf-memory.is-hearsay {
  border-left-color: var(--warn);
}

.mf-memory.is-flash {
  background: rgba(90, 169, 255, 0.2);
}

.mf-memory-id {
  color: var(--muted-2);
  font-size: 10.5px;
}

.mf-memory-importance {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  text-align: right;
}

.mf-memory-text {
  color: #cfdcec;
  line-height: 1.5;
}

/* ---------- 对话 ---------- */
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 300px;
  overflow: auto;
  margin-bottom: 10px;
}

.chat-empty {
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.6;
}

.mf-chat {
  padding: 8px 11px;
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.62;
  white-space: pre-wrap;
}

.mf-chat.is-you {
  align-self: flex-end;
  max-width: 88%;
  border: 1px solid rgba(90, 169, 255, 0.36);
  background: var(--accent-soft);
  color: #e6f1ff;
}

.mf-chat.is-agent {
  border: 1px solid var(--line);
  background: var(--surface);
  color: #dbe6f3;
}

.mf-chat-role {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted-2);
  margin-bottom: 3px;
}

.mf-chat-cited {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.mf-cite {
  padding: 1px 7px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface-3);
  color: #cfe6ff;
  font-size: 10.5px;
  cursor: default;
}

button.mf-cite {
  cursor: pointer;
}

button.mf-cite:hover {
  border-color: var(--accent);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.chat-form input {
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

/* ---------- what-if / 报告 / 工厂 ---------- */
.wi-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 10px;
  align-items: center;
  margin-bottom: 10px;
}

.wi-form select {
  padding: 6px 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.wi-form .slider-row,
.wi-form button {
  grid-column: 1 / -1;
}

.wi-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mf-kpi {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.mf-kpi-label {
  font-size: 10.5px;
  color: var(--muted-2);
}

.mf-kpi-value {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  font-weight: 700;
}

.is-up {
  color: var(--ok);
}

.is-down {
  color: var(--danger);
}

.mf-shift {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 68px;
  gap: 8px;
  align-items: baseline;
  padding: 3px 0;
  font-size: 11.5px;
}

.mf-shift-label {
  color: #cfdcec;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 460px;
  overflow: auto;
}

.mf-report-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 9px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.mf-report-stat {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.mf-report-stats-sep {
  color: var(--line-2);
}

.mf-report-section {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.mf-report-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.mf-report-id {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #cfe6ff;
}

.mf-report-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #e2ebf6;
}

.mf-report-body {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.66;
}

.mf-report-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.mf-ref {
  padding: 1px 7px;
  border: 1px dashed var(--line-2);
  border-radius: 999px;
  font-size: 10.5px;
  color: var(--muted);
}

.mf-ref.is-clickable {
  cursor: pointer;
  border-style: solid;
  color: #cfe6ff;
}

.mf-ref.is-clickable:hover {
  border-color: var(--accent);
}

.plan-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow: auto;
  margin-top: 8px;
}

.mf-bp {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}

.mf-bp-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.mf-bp-id {
  font-size: 10.5px;
  color: var(--muted-2);
}

.mf-bp-meta {
  font-size: 11px;
  color: #cfdcec;
}

.mf-bp-rationale {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
}

.chip.is-origin {
  border-color: rgba(95, 227, 227, 0.4);
  color: var(--cyan);
}

/* ---------- 控制台 ---------- */
.console {
  position: sticky;
  bottom: 0;
  z-index: 40;
  margin-top: 18px;
  border-top: 1px solid var(--line-2);
  background: rgba(7, 10, 15, 0.97);
  backdrop-filter: blur(6px);
}

.console-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  font-size: 11.5px;
  color: var(--muted);
}

.console-head .spacer {
  flex: 1 1 auto;
}

.console-toggle {
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 0;
}

.console-body {
  max-height: 190px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.console.is-collapsed .console-body {
  display: none;
}

.console-log {
  padding: 6px 16px 10px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
}

.console-line {
  display: flex;
  gap: 8px;
  align-items: baseline;
  white-space: pre-wrap;
  word-break: break-word;
}

.console-time {
  color: #4b5b70;
  flex: 0 0 auto;
}

.console-caret {
  color: #33445a;
  flex: 0 0 auto;
}

.console-tag {
  color: #7f9dbf;
  flex: 0 0 auto;
}

.console-text {
  color: #b9c8da;
}

.console-line.is-ok .console-text {
  color: #9fe8c6;
}

.console-line.is-warn .console-text {
  color: #f3d99a;
}

.console-line.is-error .console-text {
  color: #ffb3a6;
}

/* ============================================================
 * 对话式推演（主入口）
 *
 * 产品判断：用户要的是「一个输入框 → 推演结论」，而不是一堆面板。
 * 所以这块占据主视觉，工作台/图谱退居为可选的深入查看入口。
 * ============================================================ */

.chat-card {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 220px);
}

.chat-card .card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 14px;
  min-height: 0;
}

.chat-thread {
  flex: 1 1 auto;
  min-height: 320px;
  max-height: calc(100vh - 400px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 2px;
}

.chat-welcome {
  padding: 22px 22px 18px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(90, 169, 255, 0.08), transparent);
}

.chat-welcome h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-bottom: 8px;
}

.chat-welcome p {
  max-width: 74ch;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 14px;
}

.chip.is-action {
  cursor: pointer;
  border-color: rgba(90, 169, 255, 0.34);
  color: #cfe6ff;
  transition: background 0.15s, border-color 0.15s;
}

.chip.is-action:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* ---------- 消息气泡 ---------- */
.chat-msg {
  max-width: min(94%, 980px);
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg.is-user {
  align-self: flex-end;
  border: 1px solid rgba(90, 169, 255, 0.4);
  background: var(--accent-soft);
  color: #e8f2ff;
}

.chat-msg.is-system {
  align-self: flex-start;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: #dbe6f3;
}

.chat-msg.is-error {
  border-color: rgba(255, 122, 102, 0.45);
}

.chat-msg.is-hint {
  border-style: dashed;
  color: var(--muted);
}

.chat-role {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--muted-2);
  margin-bottom: 6px;
}

.chat-msg.is-user .chat-role {
  color: #9dc7f5;
}

.chat-line {
  margin-bottom: 3px;
}

.chat-meta {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-2);
}

.chat-warn {
  margin: 9px 0;
  padding: 9px 11px;
  border: 1px solid rgba(255, 200, 87, 0.45);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(255, 200, 87, 0.12), transparent);
  color: #f5e3b6;
  font-size: 12px;
  line-height: 1.6;
  white-space: normal;
}

.chat-cited {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

/* ---------- 过程卡 ---------- */
.chat-msg.is-progress {
  border-color: rgba(90, 169, 255, 0.3);
}

.chat-progress-track {
  height: 6px;
  margin: 9px 0 7px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.chat-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  transition: width 0.35s ease;
}

.chat-msg.is-done .chat-progress-fill {
  background: linear-gradient(90deg, var(--ok), var(--cyan));
}

.chat-stages {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 132px;
  overflow: auto;
}

.chat-stage {
  font-size: 11.5px;
  color: var(--muted-2);
  font-family: var(--mono);
}

/* ---------- 结论卡 ---------- */
.chat-msg.is-conclusion {
  border-color: rgba(61, 220, 151, 0.36);
  background: linear-gradient(160deg, rgba(61, 220, 151, 0.06), var(--bg-2) 42%);
}

.conclusion-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.conclusion-count {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(61, 220, 151, 0.16);
  border: 1px solid rgba(61, 220, 151, 0.4);
  color: #a9f0cd;
}

.conclusion-top {
  font-size: 12.5px;
  font-weight: 700;
  color: #e8f2ff;
}

.conclusion-conf {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
}

.conclusion-advice {
  padding: 11px 13px;
  margin-bottom: 11px;
  border: 1px solid rgba(90, 169, 255, 0.3);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(90, 169, 255, 0.1), transparent);
  font-size: 13px;
  line-height: 1.72;
  color: #e8f0fa;
  white-space: normal;
}

.chat-msg.is-conclusion .dist-bar {
  margin-bottom: 8px;
}

.conclusion-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  margin-bottom: 10px;
  font-size: 11.5px;
  color: var(--muted);
}

.conclusion-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.conclusion-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.conclusion-narrative {
  font-size: 12.5px;
  line-height: 1.72;
  color: #cfdcec;
  margin-bottom: 10px;
  white-space: normal;
}

.conclusion-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 9px;
  margin-bottom: 10px;
}

.conclusion-kpi {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.conclusion-kpi-label {
  font-size: 10.5px;
  color: var(--muted-2);
}

.conclusion-kpi-value {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  font-weight: 700;
  color: #e8f2ff;
}

.conclusion-kpi-value.is-up {
  color: var(--ok);
}

.conclusion-kpi-value.is-down {
  color: var(--danger);
}

.conclusion-turning {
  padding: 9px 11px;
  margin-bottom: 9px;
  border-left: 2px solid var(--warn);
  background: rgba(255, 200, 87, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12px;
  line-height: 1.65;
  color: #f0dfb8;
  white-space: normal;
}

.conclusion-flags {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.6;
  white-space: normal;
}

.conclusion-risk {
  color: #ffc9bf;
}

.conclusion-opp {
  color: #b6f0d4;
}

/* 产业链拓扑（能力扩展⑤）：结论卡里的一行 */
.conclusion-chain {
  padding: 9px 11px;
  margin-bottom: 10px;
  border-left: 2px solid var(--cyan);
  background: rgba(95, 227, 227, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 11.5px;
  line-height: 1.65;
  color: #cdf3f3;
  white-space: normal;
}

.conclusion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-2);
}

/* ---------- 报告卡 ---------- */
.chat-report-section {
  padding: 11px 12px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  white-space: normal;
}

.chat-report-head {
  font-size: 12.5px;
  font-weight: 700;
  color: #e2ebf6;
  margin-bottom: 6px;
}

.chat-report-body {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- 输入区 ---------- */
.chat-composer {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.chat-composer textarea {
  width: 100%;
  min-height: 52px;
  max-height: 190px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.65;
}

.chat-composer textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.composer-actions .spacer {
  flex: 1 1 auto;
}

.composer-hint {
  font-size: 11px;
  color: var(--muted-2);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .chat-thread {
    max-height: none;
  }
  .chat-msg {
    max-width: 100%;
  }
}

/* ---------- 欢迎区：对标 MIROFISH 截图 1 的单一输入入口 ---------- */
.hero-stack {
  margin-bottom: 18px;
}

.hero-title {
  font-size: 26px;
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-bottom: 10px;
  background: linear-gradient(120deg, #eaf3ff 12%, #8fc4ff 60%, #5fe3e3);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  max-width: 78ch;
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 12px;
}

.hero-steps {
  gap: 6px;
}

.hero-steps .chip {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}

.hero-examples {
  margin-top: 4px;
}

/* ---------- 四工具卡（对标 MIROFISH 截图 5 的 Interactive Tools）---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(90, 169, 255, 0.45);
  background: var(--surface);
}

.tool-card-head {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.tool-card-name {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: #cfe6ff;
}

.tool-card-desc {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
}

.conclusion-tools {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed var(--line-2);
}

/* ---------- 全景追踪表 ---------- */
.panorama-table {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.panorama-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(5, minmax(0, 0.7fr));
  gap: 8px;
  padding: 7px 10px;
  font-size: 11.5px;
  border-bottom: 1px solid var(--line);
}

.panorama-row:last-child {
  border-bottom: none;
}

.panorama-row.is-head {
  background: var(--surface-3);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
}

.panorama-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-msg.is-panorama,
.chat-msg.is-search-result,
.chat-msg.is-interview-result {
  white-space: normal;
}

/* ---------- 全景追踪：按轮次的时间切片 ---------- */
.panorama-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 9px;
}

.panorama-slice {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-2);
}

.panorama-slice.is-current {
  border-left-color: var(--ok);
  background: linear-gradient(120deg, rgba(61, 220, 151, 0.08), transparent);
}

.panorama-slice-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.panorama-round {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: #cfe6ff;
}

.chip.is-current {
  border-color: rgba(61, 220, 151, 0.45);
  color: var(--ok);
}

.panorama-metrics {
  font-size: 11px;
  color: var(--muted);
}

.panorama-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 11.5px;
}

.panorama-key {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted-2);
  min-width: 52px;
}

.panorama-event {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: #cfdcec;
  font-size: 11px;
}

.panorama-highlight {
  margin-top: 4px;
  padding-left: 10px;
  border-left: 2px solid var(--warn);
  font-size: 11.5px;
  color: #f0dfb8;
}

/* ---------- 虚拟访谈：多主体实录 ---------- */
.interview-answer {
  margin-top: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  white-space: normal;
}

.interview-who {
  font-size: 11.5px;
  font-weight: 700;
  color: #cfe6ff;
  margin-bottom: 5px;
  font-family: var(--mono);
}

.interview-body {
  font-size: 12px;
  line-height: 1.7;
  color: #dbe6f3;
  white-space: pre-wrap;
}

/* ---------- API Key（仅后端要求鉴权时出现）---------- */
.auth-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-box[hidden] {
  display: none !important;
}

.auth-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
}

.auth-row[hidden] {
  display: none !important;
}

.auth-row input {
  width: 220px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.auth-box .hint {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  white-space: nowrap;
  font-size: 11px;
  z-index: 30;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* M0 财务状态卡片 */
.fin-panel {
  margin-top: 12px;
}
.fin-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.16);
}
.fin-label {
  color: var(--muted, #8ba0b8);
  font-size: 12px;
}
.fin-value {
  font-size: 12px;
  color: #d7ebff;
}
.fin-alert {
  border-color: #f06a6a !important;
  box-shadow: 0 0 0 1px rgba(240, 106, 106, 0.35) inset;
}
.fin-warning {
  margin-top: 8px;
  color: #ff8d8d;
  font-size: 12px;
  font-weight: 700;
}

/* ============================================================
 * M0 极简产品层：首页 / 双栏工作台 / 报告 / 追问 / 图谱
 * 只覆盖展示，不删除既有 DOM。
 * ============================================================ */
body.is-landing {
  background: #f6f5f1;
  color: #17181a;
}

body.is-landing .topbar,
body.is-landing #input-panel,
body.is-landing #preview-timeline,
body.is-landing #console-panel,
body.is-landing .banner,
body.is-landing .chat-card > .card-head,
body.is-landing #chat-tools,
body.is-landing .hero-examples,
body.is-landing .hero-steps,
body.is-landing .composer-hint,
body.is-landing .chat-composer .btn-row .btn:not(#btn-chat-send) {
  display: none !important;
}

body.is-landing .layout {
  display: block;
  width: min(920px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 16vh 0 8vh;
}

body.is-landing .col-side,
body.is-landing #view-switcher {
  display: none !important;
}

body.is-landing .col-main,
body.is-landing #view-chat {
  display: block !important;
  width: 100%;
}

body.is-landing .chat-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  min-height: 0;
}

body.is-landing .chat-card > .card-body {
  padding: 0;
}

body.is-landing .chat-thread {
  min-height: 0;
  max-height: none;
  flex: 0 0 auto;
  overflow: visible;
}

body.is-landing .chat-welcome {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.is-landing .composer-actions .btn:not(#btn-chat-send),
body.is-landing .composer-actions .composer-hint {
  display: none !important;
}

body.is-landing .chat-composer .btn-row {
  border: 0;
  padding: 0 4px 4px;
  justify-content: flex-end;
}

body.is-landing .hero-title {
  margin: 0 0 20px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: #17181a;
  background: none;
  -webkit-text-fill-color: currentColor;
  text-align: center;
}

body.is-landing .hero-sub {
  max-width: 620px;
  margin: 0 auto 44px;
  font-size: 16px;
  line-height: 1.8;
  color: #666862;
  text-align: center;
}

body.is-landing .chat-composer {
  position: static;
  width: 100%;
  margin: 0;
  padding: 10px 10px 10px 18px;
  background: #ffffff;
  border: 1px solid #dedbd3;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(30, 28, 20, 0.08);
}

body.is-landing .chat-composer textarea {
  min-height: 92px;
  padding: 14px 4px;
  border: 0;
  background: transparent;
  color: #17181a;
  font-size: 16px;
  outline: none;
  resize: vertical;
}

body.is-landing .chat-composer textarea::placeholder {
  color: #99978f;
}

body.is-landing .chat-composer .btn-row {
  border: 0;
  padding: 0 4px 4px;
  justify-content: flex-end;
}

body.is-landing #btn-chat-send {
  min-height: 44px;
  padding: 0 28px;
  border-radius: 12px;
  background: #17181a;
  color: #fff;
  font-weight: 700;
}

body.is-workbench {
  background: #f4f3ee;
  color: #161719;
}

body.is-workbench .topbar {
  background: rgba(255, 255, 255, 0.92);
  color: #161719;
  border-bottom: 1px solid #e4e1d8;
}

body.is-workbench .brand-sub,
body.is-workbench .topbar-meta,
body.is-workbench #btn-toggle-side,
body.is-workbench #btn-demo-live,
body.is-workbench .view-switcher,
body.is-workbench .step-bar,
body.is-workbench .status-badge {
  display: none !important;
}

body.is-workbench .brand-title {
  font-size: 16px;
  letter-spacing: -0.01em;
}

body.is-workbench .preview-graph-btn {
  margin-left: auto;
  border-color: #ddd9cf;
  background: #fff;
  color: #333;
}

body.is-workbench .layout {
  display: grid;
  grid-template-columns: minmax(420px, 3fr) minmax(0, 7fr);
  gap: 22px;
  width: min(1500px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 22px 0 28px;
  align-items: start;
}

body.is-workbench #input-panel {
  display: none !important;
}

body.is-workbench .col-main {
  min-width: 0;
}

body.is-workbench .view-pane .card {
  background: #fff;
  border: 1px solid #e6e2d8;
  box-shadow: 0 8px 28px rgba(35, 32, 22, 0.05);
}

body.is-workbench .view-pane .card-head,
body.is-workbench .view-pane .card-foot {
  border-color: #eeeae0;
}

body.is-workbench .view-pane .card-head {
  background: #fff;
}

body.is-workbench .view-pane .card-head h2,
body.is-workbench .view-pane .card-head h3 {
  color: #1c1d1f;
}

body.is-workbench .preview-timeline {
  display: block;
  position: sticky;
  top: 88px;
  height: calc(100vh - 110px);
  min-height: 420px;
  overflow: hidden;
  border-radius: 16px;
}

body.is-workbench #console-panel {
  position: static !important;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  border: 1px solid #1d2733;
  border-radius: 16px;
  background: #0b1016;
  color: #d8e4ef;
  box-shadow: 0 18px 50px rgba(10, 14, 20, 0.18);
}

body.is-workbench #console-panel .console-head {
  background: #101720;
  border-bottom-color: #1e2936;
}

body.is-workbench #console-panel .console-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #0b1016;
}

body.is-workbench #console-panel .console-log {
  padding: 10px 12px 18px;
}

body.is-workbench #console-panel .console-text {
  color: #b9c8d6;
  font-family: var(--mono);
  font-size: 11px;
}

body.is-workbench #console-panel .console-line.is-ok .console-text {
  color: #63e6a8;
}

body.is-workbench #console-panel .console-line.is-warn .console-text {
  color: #ffd166;
}

body.is-workbench #console-panel .console-line.is-error .console-text {
  color: #ff8c7a;
}

body.is-workbench #console-panel .console-time,
body.is-workbench #console-panel .console-tag {
  color: #64788c;
}

body.is-workbench .progress-track {
  background: #f0ede5;
}

body.is-workbench .progress-fill {
  background: linear-gradient(90deg, #1f8f67, #55c796);
}

body.is-complete #progress-card,
body.is-complete #agents-card,
body.is-complete #metrics-card,
body.is-complete #timeline-card,
body.is-complete #paths-card,
body.is-complete #distribution-card,
body.is-complete #turning-card,
body.is-complete #compare-card,
body.is-complete #summary-card,
body.is-complete #overview-card,
body.is-complete .section-title {
  display: none !important;
}

.preview-report {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 34px clamp(20px, 4vw, 58px) 42px;
  color: #202124;
  background: #fff;
  border: 1px solid #e5e1d7;
  border-radius: 18px;
  box-shadow: 0 16px 50px rgba(30, 28, 20, 0.06);
}

.preview-report h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.preview-report .preview-kicker {
  margin-bottom: 24px;
  color: #8c8a80;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-report h2 {
  margin: 30px 0 10px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.preview-report p {
  margin: 8px 0;
  color: #555851;
  font-size: 14px;
  line-height: 1.85;
}

.preview-report .preview-quote {
  margin: 18px 0;
  padding: 14px 18px;
  border-left: 3px solid #b6ad96;
  background: #faf8f2;
  color: #44443f;
  border-radius: 0 8px 8px 0;
}

.preview-report ul {
  margin: 8px 0;
  padding-left: 18px;
  list-style: disc;
  color: #555851;
  line-height: 1.85;
}

.preview-ask {
  width: 100%;
  max-width: 780px;
  margin: 22px auto 0;
  padding: 20px;
  background: #fff;
  border: 1px solid #e5e1d7;
  border-radius: 16px;
}

.preview-ask-title {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #33352f;
}

.preview-ask-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-ask-item {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.7;
  background: #f7f5ef;
  color: #4b4d46;
}

.preview-ask-item.is-question {
  background: #f1efe8;
  color: #777a70;
}

.preview-ask-item.is-answer {
  border: 1px solid #e6e2d7;
  background: #fff;
}

.preview-ask-form {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.preview-ask-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #dedad0;
  border-radius: 10px;
  background: #fbfaf6;
  color: #222;
  outline: none;
}

.preview-ask-form input:focus {
  border-color: #a9a18d;
}

body.is-graph .layout {
  display: block;
  width: 100%;
  padding: 0;
}

body.is-graph #preview-timeline,
body.is-graph #input-panel {
  display: none !important;
}

body.is-graph .col-main {
  width: 100%;
}

body.is-graph #view-graph {
  display: block !important;
  height: calc(100vh - 74px);
  padding: 0;
}

body.is-graph #view-graph .card {
  height: 100%;
  border-radius: 0;
  border: 0;
  background: #0b1016;
}

body.is-graph #view-graph .card-head,
body.is-graph #view-graph .card-foot,
body.is-graph #view-graph .graph-metrics,
body.is-graph #view-graph .graph-legend,
body.is-graph #view-graph .graph-controls,
body.is-graph #view-graph .graph-hintbar {
  display: none !important;
}

body.is-graph #view-graph .card-body {
  height: 100%;
  padding: 0;
}

body.is-graph #view-graph .graph-stage {
  height: calc(100vh - 74px);
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0;
}

body.is-graph #view-graph .graph-canvas-wrap {
  height: 100%;
  border-radius: 0;
}

body.is-graph #view-graph .graph-detail {
  height: 100%;
  overflow: auto;
  border-left: 1px solid #1e2936;
}

body.is-graph .preview-graph-btn {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 80;
  background: #fff;
  border-color: #ddd9cf;
  color: #222;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
}

@media (max-width: 900px) {
  body.is-workbench .layout {
    display: block;
    width: calc(100vw - 24px);
  }

  body.is-workbench .preview-timeline {
    position: relative;
    top: 0;
    height: 420px;
    margin-top: 18px;
  }

  .preview-report {
    padding: 26px 20px 32px;
  }
}

/* ============================================================
 * MiroFish 风格重构：白底顶栏 / Step 1 双栏首页 / Step 2 主体工作台
 * Step 3 报告 + Interactive Tools / 底部深色控制台
 * ============================================================ */

body {
  background: #f6f5f1;
}

body.is-landing .topbar,
body.is-workbench .topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex !important;
  align-items: center;
  gap: 20px;
  height: 64px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e6e2d8;
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(20, 20, 18, 0.02);
}

body.is-landing .brand-mark,
body.is-workbench .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #17181a;
  color: #fff;
  font-size: 16px;
  box-shadow: none;
}

body.is-landing .brand-title,
body.is-workbench .brand-title {
  color: #17181a;
  font-size: 16px;
  letter-spacing: 0.12em;
}

body.is-landing .brand-sub,
body.is-workbench .brand-sub {
  color: #9a978d;
  font-size: 10px;
  letter-spacing: 0.06em;
}

body.is-landing .view-switcher,
body.is-workbench .view-switcher {
  order: 2;
  display: flex !important;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
  padding: 4px;
  border: 1px solid #e8e4da;
  border-radius: 999px;
  background: #faf9f5;
}

body.is-landing #view-switcher {
  display: flex !important;
}

body.is-landing #btn-view-chat,
body.is-landing #btn-view-overview,
body.is-workbench #btn-view-chat,
body.is-workbench #btn-view-overview {
  display: none !important;
}

body.is-landing .view-tab,
body.is-workbench .view-tab {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #77766f;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
}

body.is-landing .view-tab.is-active,
body.is-workbench .view-tab.is-active {
  background: #17181a;
  color: #fff;
}

body.is-landing .step-bar,
body.is-workbench .step-bar {
  order: 3;
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

body.is-landing .step-count,
body.is-workbench .step-count {
  color: #17181a;
  font-size: 12px;
  font-weight: 700;
}

body.is-landing .step-stage,
body.is-workbench .step-stage {
  color: #8d8a81;
  font-size: 11px;
}

body.is-landing .step-dots,
body.is-workbench .step-dots {
  display: flex;
  gap: 5px;
}

body.is-landing .step-dot,
body.is-workbench .step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d8d4c9;
}

body.is-landing .step-dot.is-active,
body.is-workbench .step-dot.is-active {
  background: #17181a;
}

body.is-landing .mf-status,
body.is-workbench .mf-status {
  order: 4;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid #e5e1d7;
  border-radius: 999px;
  background: #fff;
  color: #6f6e66;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.mf-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #37b77c;
  box-shadow: 0 0 0 3px rgba(55, 183, 124, 0.12);
}

body.is-landing .topbar-meta,
body.is-workbench .topbar-meta,
body.is-landing .status-badge,
body.is-workbench .status-badge,
body.is-landing .preview-graph-btn,
body.is-workbench .preview-graph-btn,
body.is-landing #btn-toggle-side,
body.is-workbench #btn-toggle-side,
body.is-landing #btn-demo-live,
body.is-workbench #btn-demo-live,
body.is-landing .topbar-spacer,
body.is-workbench .topbar-spacer {
  display: none !important;
}

body.is-landing .layout {
  display: block;
  width: min(1240px, calc(100vw - 72px));
  margin: 0 auto;
  padding: 112px 0 70px;
}

body.is-landing #view-chat {
  display: block !important;
}

body.is-landing .chat-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  min-height: 0;
}

body.is-landing .chat-card > .card-head {
  display: none !important;
}

body.is-landing .chat-card > .card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.92fr);
  gap: clamp(34px, 6vw, 92px);
  align-items: start;
  padding: 0;
}

body.is-landing .chat-thread {
  grid-column: 1;
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding: 10px 0 0;
}

body.is-landing .chat-welcome {
  padding: 0;
  border: 0;
  background: transparent;
}

body.is-landing .mf-kicker {
  color: #a39f93;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

body.is-landing .hero-title {
  margin: 16px 0 18px;
  color: #17181a;
  font-size: clamp(42px, 5vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.055em;
  text-align: left;
  font-weight: 800;
}

body.is-landing .hero-sub {
  max-width: 480px;
  margin: 0 0 30px;
  color: #6d6b63;
  font-size: 15px;
  line-height: 1.9;
  text-align: left;
}

.mf-step-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 430px;
  border-top: 1px solid #e9e5dc;
}

.mf-step-list > div {
  display: grid;
  grid-template-columns: 30px 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  padding: 13px 0;
  border-bottom: 1px solid #e9e5dc;
}

.mf-step-list span {
  grid-row: 1 / span 2;
  color: #b8b2a5;
  font-family: var(--mono);
  font-size: 10px;
}

.mf-step-list b {
  color: #2a2b29;
  font-size: 13px;
  font-weight: 700;
}

.mf-step-list em {
  color: #96938a;
  font-size: 11px;
  font-style: normal;
}

body.is-landing .chat-composer {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 30px;
  margin: 0;
  border: 1px solid #e4e0d5;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(40, 36, 24, 0.08);
}

.mf-home-card-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 22px;
}

.mf-home-card-head h4 {
  margin: 0;
  color: #1e1f1d;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.mf-upload {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  margin-bottom: 18px;
  border: 1px dashed #d9d3c5;
  border-radius: 14px;
  background: #fbfaf6;
  cursor: pointer;
}

.mf-upload:hover {
  border-color: #a9a18d;
  background: #f8f6ef;
}

.mf-upload-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  background: #f0ede4;
  color: #777266;
  font-size: 20px;
}

.mf-upload b {
  display: block;
  color: #3b3c38;
  font-size: 12px;
}

.mf-upload span {
  display: block;
  margin-top: 4px;
  color: #9a978d;
  font-size: 10px;
}

.mf-field-label {
  margin: 0 0 8px;
  color: #8d8a81;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.is-landing .chat-composer textarea {
  min-height: 140px;
  padding: 16px;
  border: 1px solid #e8e4da;
  border-radius: 12px;
  background: #fdfcf8;
  color: #262724;
  font-size: 14px;
  line-height: 1.75;
  resize: vertical;
}

body.is-landing .chat-composer textarea::placeholder {
  color: #aaa69b;
}

body.is-landing .composer-actions {
  margin-top: 14px;
  padding: 0;
}

body.is-landing .composer-actions .btn:not(#btn-chat-send),
body.is-landing .composer-actions .composer-hint,
body.is-landing .chat-composer > .composer-hint,
body.is-landing #chat-tools,
body.is-landing .hero-examples,
body.is-landing .hero-steps {
  display: none !important;
}

body.is-landing #btn-chat-send {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  background: #17181a;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

/* ---------- Step 2 工作台 ---------- */

body.is-workbench {
  padding-top: 64px;
  background: #f6f5f1;
}

body.is-workbench .layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 4fr);
  gap: 22px;
  width: min(1500px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 24px 0 190px;
  align-items: start;
}

body.is-workbench .col-main {
  min-width: 0;
}

body.is-workbench #view-overview {
  display: block;
}

body.is-workbench:not(.is-complete) #view-overview > :not(#mf-step2) {
  display: none !important;
}

body.is-workbench:not(.is-complete) #mf-step2 {
  display: block;
}

body.is-workbench .preview-timeline {
  display: block;
  position: sticky;
  top: 88px;
  height: calc(100vh - 280px);
  min-height: 380px;
  overflow: hidden;
  border: 1px solid #1d2733;
  border-radius: 18px;
  background: #0b1016;
}

body.is-workbench .preview-timeline[hidden] {
  display: none;
}

.mf-action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #1e2936;
  background: #101720;
}

.mf-action-head .mf-kicker {
  color: #708196;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.mf-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #49d69b;
  box-shadow: 0 0 0 4px rgba(73, 214, 155, 0.1);
}

.mf-action-log {
  height: calc(100% - 47px);
  overflow: auto;
  padding: 10px 16px 16px;
  color: #9fb1c2;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.8;
}

.mf-action-line {
  display: flex;
  gap: 9px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(110, 135, 158, 0.08);
}

.mf-action-line time {
  color: #5e7388;
  flex: 0 0 auto;
}

.mf-action-line b {
  color: #6fe2ad;
  font-weight: 500;
}

.mf-action-line.is-warn b {
  color: #ffcf6e;
}

.mf-action-line.is-error b {
  color: #ff8d7d;
}

.mf-action-line span {
  color: #a8bac9;
}

.mf-step2 {
  max-width: 780px;
}

.mf-panel-head {
  margin-bottom: 22px;
}

.mf-panel-head h2 {
  margin: 8px 0 6px;
  color: #1c1d1f;
  font-size: 28px;
  letter-spacing: -0.035em;
}

.mf-panel-head p {
  margin: 0;
  color: #8d8a81;
  font-size: 12px;
  line-height: 1.7;
}

.mf-panel-head.compact h2 {
  font-size: 18px;
}

.mf-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e6e2d8;
  color: #4b4c46;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mf-subhead b {
  color: #aaa69b;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
}

.mf-agent-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mf-dynamic-note {
  margin: -2px 0 10px;
  padding: 9px 11px;
  border: 1px solid #e7e2d7;
  border-radius: 9px;
  background: #faf8f2;
  color: #77756c;
  font-size: 10px;
  line-height: 1.6;
}

.mf-agent-card {
  padding: 14px;
  border: 1px solid #e6e2d8;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(35, 32, 22, 0.035);
}

.mf-agent-card header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.mf-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  background: #f0ede5;
  color: #56574f;
  font-size: 10px;
  font-weight: 700;
}

.mf-agent-card b {
  display: block;
  color: #2b2c29;
  font-size: 11px;
}

.mf-agent-card small {
  color: #9d9a90;
  font-size: 9px;
}

.mf-agent-card p {
  margin: 0 0 9px;
  color: #77776f;
  font-size: 10px;
  line-height: 1.65;
}

.mf-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.mf-tags span {
  padding: 3px 6px;
  border-radius: 5px;
  background: #f5f2ea;
  color: #89867b;
  font-size: 8px;
}

.mf-config {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mf-config > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border: 1px solid #e6e2d8;
  border-radius: 10px;
  background: #fff;
}

.mf-config span {
  color: #96938a;
  font-size: 10px;
}

.mf-config b {
  color: #3e3f3a;
  font-size: 10px;
  font-weight: 600;
}

/* ---------- Step 3 报告 / 右侧 Interactive ---------- */

body.is-complete .layout {
  display: block;
  padding-bottom: 190px;
}

body.is-complete .col-main {
  width: 100%;
}

body.is-complete #preview-timeline {
  display: none !important;
}

body.is-complete #view-overview {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(360px, 2fr);
  gap: 26px;
  align-items: start;
}

body.is-complete #mf-step2,
body.is-complete #progress-card,
body.is-complete #agents-card,
body.is-complete #metrics-card,
body.is-complete #timeline-card,
body.is-complete #paths-card,
body.is-complete #distribution-card,
body.is-complete #turning-card,
body.is-complete #compare-card,
body.is-complete #summary-card,
body.is-complete #overview-card,
body.is-complete .section-title {
  display: none !important;
}

body.is-complete .preview-report {
  grid-column: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 38px clamp(24px, 4vw, 52px) 46px;
  border-radius: 18px;
}

body.is-complete .preview-ask {
  grid-column: 2;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 22px;
  border-radius: 18px;
  position: sticky;
  top: 88px;
}

.preview-report h1 {
  font-size: clamp(34px, 3.8vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.065em;
  font-weight: 800;
}

.preview-report .preview-report-meta {
  display: flex;
  gap: 12px;
  margin: 10px 0 28px;
  color: #9a978d;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-report h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 30px 0 12px;
  color: #1f201e;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.preview-report h2::before {
  color: #b6ad96;
  font-family: var(--mono);
  font-size: 10px;
  content: attr(data-index);
}

.preview-report details {
  margin: 10px 0;
  border-top: 1px solid #ece8de;
  padding-top: 10px;
}

.preview-report summary {
  cursor: pointer;
  color: #33352f;
  font-size: 13px;
  font-weight: 700;
}

.preview-report ul {
  padding-left: 18px;
}

.preview-report li {
  margin: 6px 0;
  color: #5b5d55;
  font-size: 13px;
  line-height: 1.8;
}

.preview-report .preview-quote {
  margin: 16px 0;
  padding: 14px 16px;
  border-left: 2px solid #b8ae96;
  background: #faf8f2;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
}

.exec-cockpit {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 4px;
  padding: 14px;
  border: 1px solid #e4dfd4;
  border-radius: 14px;
  background: #fbfaf6;
}

.exec-cockpit-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-left: 1px solid #e8e3d8;
}

.exec-cockpit-item:first-child {
  border-left: 0;
}

.exec-cockpit-item span {
  color: #96938a;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.exec-cockpit-item b {
  color: #252622;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .exec-cockpit {
    grid-template-columns: 1fr;
  }

  .exec-cockpit-item {
    border-left: 0;
    border-top: 1px solid #e8e3d8;
  }

  .exec-cockpit-item:first-child {
    border-top: 0;
  }
}

.preview-trend {
  width: 100%;
  margin: 8px 0 4px;
  border-collapse: collapse;
  font-size: 11px;
}

.preview-trend th,
.preview-trend td {
  padding: 7px 8px;
  border-bottom: 1px solid #ece8de;
  text-align: right;
  white-space: nowrap;
}

.preview-trend th:first-child,
.preview-trend td:first-child {
  text-align: left;
}

.preview-trend th {
  color: #8d8a81;
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

b.is-complete .preview-ask-title {
  display: none;
}

.mf-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.mf-tool-grid button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px;
  border: 1px solid #e6e2d8;
  border-radius: 11px;
  background: #fbfaf6;
  text-align: left;
  cursor: pointer;
}

.mf-tool-grid button:hover {
  border-color: #bfb6a2;
  background: #f7f4ec;
}

.mf-tool-grid b {
  color: #34352f;
  font-size: 10px;
  font-weight: 700;
}

.mf-tool-grid span {
  color: #96938a;
  font-size: 9px;
  line-height: 1.5;
}

body.is-complete .preview-ask-log {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

body.is-complete .preview-ask-item {
  padding: 12px 14px;
  border: 1px solid #eae6dc;
  border-radius: 12px;
  background: #fff;
  font-size: 12px;
  line-height: 1.8;
}

body.is-complete .preview-ask-item.is-question {
  margin-left: 26px;
  background: #f7f5ef;
  border-color: transparent;
}

body.is-complete .preview-ask-item.is-answer {
  border-left: 2px solid #b8ae96;
}

body.is-complete .preview-ask-form {
  margin-top: 14px;
}

body.is-complete .preview-ask-form input {
  padding: 12px 12px;
  border-radius: 9px;
  background: #fbfaf6;
  font-size: 11px;
}

body.is-complete .preview-ask-form .btn {
  min-height: 40px;
  border-radius: 9px;
  padding: 0 16px;
  font-size: 11px;
}

/* ---------- 底部深色控制台 ---------- */

body.is-workbench #mf-bottom-console {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: block;
  height: 148px;
  padding: 0 20px;
  border-top: 1px solid #1d2733;
  background: #080c11;
  box-shadow: 0 -10px 30px rgba(8, 12, 17, 0.16);
}

body.is-workbench #console-panel {
  height: 100%;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.is-workbench #console-panel .console-head {
  height: 34px;
  padding: 0 8px;
  background: transparent;
  border-bottom: 1px solid #1a2430;
}

body.is-workbench #console-panel .console-body {
  height: calc(100% - 34px);
  overflow: auto;
}

body.is-workbench #console-panel .console-log {
  padding: 6px 8px 10px;
}

body.is-workbench #console-panel .console-line {
  padding: 1px 0;
  font-size: 10px;
}

body.is-workbench #console-panel .console-text {
  color: #9fb1c2;
  font-family: var(--mono);
  font-size: 10px;
}

/* ---------- 图谱 ---------- */

body.is-graph #view-graph {
  height: calc(100vh - 64px);
}

body.is-graph #view-graph .graph-stage {
  height: calc(100vh - 64px);
  display: block;
  position: relative;
}

body.is-graph #view-graph .graph-canvas-wrap {
  height: 100%;
}

body.is-graph #view-graph .graph-detail {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 20;
  width: 320px;
  max-height: calc(100% - 40px);
  height: auto;
  overflow: auto;
  border: 1px solid rgba(120, 145, 168, 0.22);
  border-radius: 14px;
  background: rgba(16, 23, 32, 0.92);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
}

body.is-graph #view-graph .graph-detail .empty {
  color: #8195a8;
}

body.is-graph #view-graph .graph-detail [class*="detail"] {
  color: #c7d8e6;
}

@media (max-width: 900px) {
  body.is-landing .layout {
    width: calc(100vw - 32px);
    padding-top: 92px;
  }

  body.is-landing .chat-card > .card-body {
    display: flex;
    flex-direction: column;
    gap: 30px;
  }

  body.is-landing .chat-thread,
  body.is-landing .chat-composer {
    width: 100%;
  }

  body.is-workbench .layout {
    display: block;
    width: calc(100vw - 24px);
  }

  body.is-workbench .preview-timeline {
    position: relative;
    top: 0;
    height: 380px;
    margin-top: 18px;
  }

  body.is-complete #view-overview {
    display: flex;
    flex-direction: column;
  }

  body.is-complete .preview-ask {
    position: static;
  }

  body.is-workbench #mf-bottom-console {
    height: 118px;
    padding: 0 8px;
  }

  body.is-workbench .layout {
    padding-bottom: 150px;
  }

  .mf-agent-list {
    grid-template-columns: 1fr;
  }

  body.is-landing .view-switcher,
  body.is-workbench .view-switcher {
    display: none !important;
  }
}

/* ============================================================
 * MiroFish 式报告：左报告 / 右工作流
 * ============================================================ */
body.is-complete .preview-report {
  grid-column: 1 / -1;
}

body.is-complete .preview-ask {
  grid-column: 1 / -1;
  position: static;
}

.miro-report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 34px;
  align-items: start;
}

.miro-report-main {
  min-width: 0;
}

.miro-kicker {
  margin-bottom: 12px;
  color: #a09b8e;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.preview-report h1.miro-title {
  margin: 0 0 12px;
  color: #171816;
  font-family: var(--font);
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.06;
}

.miro-subtitle {
  max-width: 760px;
  color: #62645c;
  font-size: 13px;
  line-height: 1.75;
}

.miro-meta {
  margin: 16px 0 26px;
  color: #a39e91;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.miro-verdict {
  margin: 0 0 30px;
  padding: 18px 20px;
  border: 1px solid #e8e3d8;
  border-left: 3px solid #23241f;
  background: #fbfaf6;
}

.miro-verdict-k {
  margin-bottom: 8px;
  color: #9f998a;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.miro-verdict-v {
  margin-bottom: 8px;
  color: #1d1e1a;
  font-size: 15px;
  font-weight: 700;
}

.miro-verdict p {
  margin: 0;
  color: #55574f;
  font-size: 12px;
  line-height: 1.75;
}

.miro-verdict-note {
  margin-top: 10px;
  color: #9c978a;
  font-family: var(--mono);
  font-size: 9px;
}

.miro-section {
  padding: 22px 0 20px;
  border-top: 1px solid #ece8de;
}

.miro-section-code {
  margin-bottom: 8px;
  color: #a49d8d;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-report h2.miro-section-title {
  margin: 0 0 14px;
  color: #1e1f1b;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.preview-report h2.miro-section-title::before {
  content: none;
}

.miro-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0;
}

.miro-item p {
  margin: 0;
  color: #4c4e47;
  font-size: 13px;
  line-height: 1.85;
}

.miro-layer {
  flex: 0 0 auto;
  margin-top: 3px;
  padding: 2px 5px;
  border: 1px solid #e5dfd2;
  color: #8d8779;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.miro-layer-view {
  border-color: #d7cbb5;
  color: #8f7b4f;
}

.miro-layer-analysis {
  border-color: #cbd8cf;
  color: #5f7b69;
}

.miro-layer-fact {
  border-color: #d8d3c8;
  color: #66645d;
}

.preview-report details.miro-evidence {
  margin: 6px 0 14px 52px;
  border-top: 1px dashed #e5e0d4;
  padding-top: 6px;
}

.preview-report details.miro-evidence summary {
  color: #8e897d;
  font-size: 10px;
  font-weight: 500;
}

.miro-dissent {
  padding: 22px 0;
  border-top: 1px solid #ece8de;
}

.miro-dissent h2 {
  margin: 0 0 10px;
  color: #242520;
  font-size: 16px;
}

.miro-dissent-row {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed #eee9de;
  font-size: 12px;
  line-height: 1.75;
}

.miro-dissent-row b {
  flex: 0 0 100px;
  color: #777164;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
}

.miro-dissent-row span {
  color: #595b53;
}

.miro-source {
  padding: 18px 0 0;
  border-top: 1px solid #ece8de;
}

.miro-source h4 {
  margin-bottom: 8px;
  color: #8e897c;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.miro-source p {
  color: #777970;
  font-size: 11px;
  line-height: 1.8;
}

.miro-report-side {
  position: sticky;
  top: 22px;
  padding-left: 20px;
  border-left: 1px solid #ece7db;
}

.miro-side-kicker {
  margin: 0 0 10px;
  color: #a39d8e;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.miro-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: 10px;
}

.miro-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #f0ece3;
}

.miro-metric span {
  color: #9d9789;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.miro-metric b {
  color: #34352f;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.miro-status {
  margin: 10px 0 22px;
  color: #5f7b69;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.miro-workflow {
  margin-bottom: 24px;
}

.miro-wf-row {
  display: flex;
  gap: 9px;
  padding: 7px 0;
}

.miro-wf-index {
  flex: 0 0 20px;
  color: #b1aa9a;
  font-family: var(--mono);
  font-size: 9px;
}

.miro-wf-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.miro-wf-body b {
  color: #464841;
  font-size: 11px;
  font-weight: 600;
}

.miro-wf-body span {
  color: #a39d90;
  font-family: var(--mono);
  font-size: 8px;
}

.miro-timeline {
  padding-top: 2px;
}

.miro-tl-row {
  display: flex;
  gap: 9px;
  padding: 6px 0;
}

.miro-tl-dot {
  width: 5px;
  height: 5px;
  margin-top: 5px;
  border-radius: 50%;
  background: #9b9588;
}

.miro-tl-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.miro-tl-body b {
  color: #55574f;
  font-size: 10px;
  font-weight: 600;
}

.miro-tl-body span {
  color: #a29d90;
  font-size: 9px;
}

.miro-tl-done {
  margin-top: 8px;
  color: #5f7b69;
  font-family: var(--mono);
  font-size: 9px;
}

@media (max-width: 980px) {
  .miro-report-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .miro-report-side {
    position: static;
    padding-left: 0;
    padding-top: 18px;
    border-left: 0;
    border-top: 1px solid #ece7db;
  }
}

/* ---------- Step 1：历史回测副标签页 ---------- */
.mode-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 3px;
  border: 1px solid var(--line, #e6e0d4);
  border-radius: 8px;
  background: #f6f2e9;
}
.mode-tab {
  flex: 1 1 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #777267;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.mode-tab.is-active {
  background: #fffdf8;
  color: #2f2c26;
  box-shadow: 0 1px 3px rgba(45, 40, 30, 0.12);
}
#backtest-mode .field select { width: 100%; }
.backtest-verdict {
  margin: 4px 0 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f7f3e9;
  color: #4f4a3f;
  font-size: 12px;
  line-height: 1.5;
}
.backtest-verdict strong { color: #2f6b4a; }
.backtest-verdict.is-low strong { color: #9a5b35; }
.backtest-legend {
  display: flex;
  gap: 14px;
  margin-bottom: 4px;
  color: #8a8375;
  font-size: 10px;
}
.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-radius: 50%;
}
.legend-dot.predicted { background: #4f7c63; }
.legend-dot.actual { background: #b58a4a; }
#backtest-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 180px;
  border: 1px solid #eee7d8;
  border-radius: 7px;
  background: #fffefb;
}
.backtest-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}
.backtest-metric {
  padding: 8px;
  border: 1px solid #eee7d8;
  border-radius: 6px;
  background: #fffefb;
}
.backtest-metric b {
  display: block;
  margin-bottom: 3px;
  color: #8a8375;
  font-size: 9px;
  font-weight: 500;
}
.backtest-metric span {
  color: #3e3a32;
  font-family: var(--mono);
  font-size: 11px;
}
.backtest-diagnosis {
  margin-top: 10px;
  padding: 9px 10px;
  border-left: 3px solid #c6a15b;
  border-radius: 4px;
  background: #fbf7ed;
  color: #6b6356;
  font-size: 11px;
  line-height: 1.65;
}
@media (max-width: 640px) {
  .backtest-metrics { grid-template-columns: 1fr; }
}

.backtest-trend {
  margin-top: 9px;
  padding: 8px 10px;
  border: 1px dashed #e3d9c4;
  border-radius: 6px;
  color: #6b6356;
  font-size: 10px;
  line-height: 1.6;
}
.backtest-trend b {
  color: #4f4a3f;
  font-weight: 600;
}

/* ---------- 行业原型：高管驾驶舱 ---------- */
.archetype-badge {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 12px;
  padding: 12px 14px;
  border: 1px solid #d8c9aa;
  border-left: 4px solid #b58a4a;
  border-radius: 7px;
  background: #fbf7ed;
}
.archetype-badge-kicker {
  color: #a29d90;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}
.archetype-badge strong {
  color: #4d4437;
  font-size: 15px;
  font-weight: 600;
}
.archetype-badge-count {
  margin-left: auto;
  color: #8a8375;
  font-family: var(--mono);
  font-size: 9px;
}
.archetype-cockpit {
  margin: 0 0 20px;
  padding: 14px;
  border: 1px solid #eee7d8;
  border-radius: 8px;
  background: #fffefb;
}
.archetype-cockpit-kicker {
  color: #a29d90;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}
.archetype-cockpit h2 {
  margin: 5px 0 12px;
  color: #4d4437;
  font-size: 15px;
  font-weight: 600;
}
.archetype-cockpit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.archetype-cockpit-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid #f0eadc;
  border-radius: 6px;
  background: #fcfaf4;
}
.archetype-cockpit-card span {
  color: #8a8375;
  font-size: 9px;
}
.archetype-cockpit-card b {
  color: #3e3a32;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
}
@media (max-width: 640px) {
  .archetype-cockpit-grid { grid-template-columns: 1fr; }
  .archetype-badge-count { margin-left: 0; }
}

/* ---------- M2 SaaS：登录 / BYOK ---------- */
.saas-box { display: flex; align-items: center; gap: 7px; }
.saas-user { color: #777267; font-size: 10px; }
.saas-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(38, 34, 27, 0.35);
}
.saas-panel {
  position: relative;
  width: min(460px, 94vw);
  max-height: 90vh;
  overflow: auto;
  padding: 20px;
  border-radius: 10px;
  background: #fffdf8;
  box-shadow: 0 18px 50px rgba(35, 30, 22, 0.24);
}
.saas-panel h2 { margin: 0 0 14px; font-size: 18px; }
.saas-close { position: absolute; top: 10px; right: 10px; }
.saas-auth .field, .saas-settings .field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.saas-auth .field span, .saas-settings .field span { color: #777267; font-size: 10px; }
.saas-auth input, .saas-settings input, .saas-settings select {
  width: 100%; padding: 8px 9px; border: 1px solid #e3dccd; border-radius: 6px;
  background: #fffefb; color: #3e3a32; font: inherit; font-size: 12px;
}
.saas-settings { border-top: 1px solid #eee7d8; padding-top: 12px; }
.saas-settings .btn-row { flex-wrap: wrap; }

#startup-trend {
  width: 100%;
  height: auto;
  margin: 2px 0 8px;
  border: 1px solid #eee7d8;
  border-radius: 7px;
  background: #fffefb;
}

/* ---------- M2 SaaS：积分与场景分类 ---------- */
.saas-credits {
  padding: 3px 8px;
  border: 1px solid #e3d6bd;
  border-radius: 999px;
  background: #fbf4e5;
  color: #7a5c2e;
  font-size: 10px;
  white-space: nowrap;
}
.saas-balance-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 12px;
  margin: 8px 0;
  border: 1px solid #eadfc9;
  border-radius: 7px;
  background: #fbf7ed;
  font-size: 12px;
}
.saas-balance-row b { color: #7a5c2e; font: 600 20px/1.2 ui-monospace, monospace; }
.scene-tabs {
  display: flex;
  gap: 5px;
  padding: 3px;
  margin-bottom: 10px;
  border: 1px solid #e5ddcd;
  border-radius: 7px;
  background: #f7f2e7;
}
.scene-tab {
  flex: 1;
  padding: 7px 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #7b7467;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.scene-tab.is-active {
  background: #fffdf8;
  color: #3e3a32;
  box-shadow: 0 1px 2px rgba(60, 50, 35, .08);
}

/* ---------- 极速 / 深度推演模式 ---------- */
.run-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 2px 0 12px;
}
.run-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 9px;
  border: 1px solid #e5ddcd;
  border-radius: 7px;
  background: #fbf8f1;
  cursor: pointer;
}
.run-mode-option:has(input:checked) {
  border-color: #b58a4a;
  background: #fbf3e3;
}
.run-mode-option input { margin-top: 2px; }
.run-mode-option b { display: block; font-size: 11px; color: #3e3a32; }
.run-mode-option small { display: block; margin-top: 2px; color: #8a8375; font-size: 9px; }

/* ============================================================
 * SaaS 登录弹窗：改为真正的视口级弹窗
 * 旧版嵌在 .topbar 内，topbar 的 backdrop-filter 会建立 fixed 包含块，
 * 弹窗被 header 裁切（截图里标题和输入框上半截丢失）。
 * ============================================================ */
body.saas-open { overflow: hidden; }

.saas-modal {
  background: rgba(20, 17, 12, 0.48);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: saas-backdrop-in 0.16s ease-out;
}

.saas-panel {
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 28px 24px 24px;
  border: 1px solid #e8e0d1;
  border-radius: 16px;
  background: #fffdf8;
  box-shadow: 0 24px 70px rgba(25, 21, 15, 0.28);
  animation: saas-panel-in 0.18s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.saas-panel h2 {
  margin: 0 0 18px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.saas-close {
  top: 14px;
  right: 14px;
  font-size: 11px;
}

.saas-auth .field,
.saas-settings .field {
  gap: 7px;
  margin-bottom: 14px;
}

.saas-auth .field span,
.saas-settings .field span {
  color: #6f6a60;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.saas-auth input,
.saas-settings input,
.saas-settings select {
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.saas-auth .btn-row { margin-top: 4px; }
.saas-auth .btn-primary { flex: 1; }

@keyframes saas-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes saas-panel-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

/* HTML 的 hidden 必须压过 .saas-modal 的 display:flex */
.saas-modal[hidden] { display: none !important; }

/* Landing：去掉尚未开始推演时的空标签页；把示例命题露出来，降低首次输入成本。 */
body.is-landing #view-switcher { display: none !important; }

body.is-landing .hero-examples {
  display: block !important;
  margin-top: 18px;
  max-width: 460px;
}

body.is-landing .hero-examples .ctrl-label {
  margin-bottom: 10px;
  color: #858176;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.is-landing .hero-examples .chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.is-landing .hero-examples .chip {
  padding: 8px 11px;
  border: 1px solid #e2ddd1;
  border-radius: 999px;
  background: #fffdf8;
  color: #5e5a51;
  font-size: 11px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

body.is-landing .hero-examples .chip:hover {
  border-color: #b9b09e;
  background: #fff;
  color: #1d1e1a;
}

/* Mobile landing: put the input form in the first screen, not after a long manifesto. */
@media (max-width: 720px) {
  body.is-landing .mf-step-list { display: none !important; }
  body.is-landing .hero-title { font-size: 38px; margin-bottom: 14px; }
  body.is-landing .hero-sub { margin-bottom: 22px; font-size: 14px; }
  body.is-landing .chat-thread { padding-top: 0; }
  body.is-landing .chat-composer { margin-top: 4px; padding: 18px; border-radius: 14px; }
  body.is-landing .hero-examples { display: none !important; }
  body.is-landing .chat-composer textarea { min-height: 104px; }
}

@media (max-width: 720px) {
  body.is-landing { overflow-x: hidden; }
  body.is-landing .layout {
    width: calc(100vw - 24px) !important;
    padding-left: 0;
    padding-right: 0;
  }
  body.is-landing .chat-card,
  body.is-landing .chat-card > .card-body,
  body.is-landing .chat-composer,
  body.is-landing .chat-composer textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
}

/* ============================================================
 * 产品官网风 Landing：输出物、原则与 CTA
 * ============================================================ */
.landing-nav { display: none; }

body.is-landing .landing-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: 30px;
}

body.is-landing .landing-nav a {
  color: #6f6b61;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.15s;
}

body.is-landing .landing-nav a:hover { color: #17181a; }

/* 产品官网不需要把 Step / Ready 工程状态放在首屏 */
body.is-landing .step-bar,
body.is-landing .mf-status { display: none !important; }

.landing-trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid #ece7dc;
  color: #8b8578;
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.landing-trust span + span::before {
  content: "·";
  margin: 0 9px;
  color: #bdb7a9;
}

body:not(.is-landing) .landing-trust { display: none !important; }

.landing-showcase { display: none; }

body.is-landing .landing-showcase {
  display: block;
  border-top: 1px solid #e3ded2;
  background: #f1efe8;
}

.landing-showcase-inner {
  width: min(1240px, calc(100vw - 72px));
  margin: 0 auto;
  padding: 82px 0 92px;
}

.showcase-head {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  gap: clamp(30px, 5vw, 80px);
  align-items: end;
}

.showcase-kicker {
  margin-bottom: 15px;
  color: #8a8478;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.showcase-head h2 {
  margin: 0;
  color: #17181a;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.showcase-lede {
  margin: 0;
  padding-left: 22px;
  border-left: 2px solid #17181a;
  color: #6d6b63;
  font-size: 14px;
  line-height: 1.9;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 54px;
  border-top: 1px solid #d8d2c4;
}

.showcase-card {
  min-width: 0;
  padding: 22px 22px 6px 0;
  border-right: 1px solid #ded8ca;
}

.showcase-card + .showcase-card { padding-left: 22px; }
.showcase-card:last-child { border-right: 0; }

.showcase-num {
  display: block;
  margin-bottom: 28px;
  color: #969082;
  font-family: var(--mono);
  font-size: 11px;
}

.showcase-card h3 {
  margin: 0 0 10px;
  color: #242520;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.showcase-card p {
  margin: 0;
  color: #777268;
  font-size: 12.5px;
  line-height: 1.75;
}

.showcase-principle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-top: 54px;
  padding: 30px 34px;
  background: #17181a;
  color: #f7f4eb;
}

.showcase-quote {
  margin: 0;
  font-size: clamp(18px, 2.1vw, 25px);
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.showcase-principles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.showcase-principles span {
  padding: 7px 10px;
  border: 1px solid #4a4b45;
  color: #cfcbc0;
  font-size: 10.5px;
  white-space: nowrap;
}

.showcase-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 62px;
  padding-top: 28px;
  border-top: 1px solid #d8d2c4;
}

.showcase-cta h3 {
  margin: 0;
  color: #242520;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.showcase-cta .showcase-kicker { margin-bottom: 8px; }

.showcase-cta-btn {
  min-width: 170px;
  min-height: 44px;
  border-radius: 999px;
  background: #17181a;
  color: #fff;
  font-size: 12px;
}

@media (max-width: 900px) {
  body.is-landing .landing-nav { display: none; }
  .showcase-head { grid-template-columns: 1fr; align-items: start; }
  .showcase-lede { padding-left: 18px; }
  .showcase-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .showcase-card:nth-child(2) { border-right: 0; }
  .showcase-card:nth-child(3),
  .showcase-card:nth-child(4) { border-top: 1px solid #ded8ca; }
  .showcase-card:nth-child(4) { border-right: 0; }
}

@media (max-width: 720px) {
  .landing-showcase-inner {
    width: calc(100vw - 32px);
    padding: 56px 0 64px;
  }
  .showcase-head h2 { font-size: 32px; }
  .showcase-grid { grid-template-columns: 1fr; margin-top: 36px; }
  .showcase-card,
  .showcase-card + .showcase-card {
    padding: 18px 0;
    border-right: 0;
    border-bottom: 1px solid #ded8ca;
  }
  .showcase-card:last-child { border-bottom: 0; }
  .showcase-num { margin-bottom: 12px; }
  .showcase-principle { align-items: flex-start; flex-direction: column; padding: 24px; }
  .showcase-principles { justify-content: flex-start; }
  .showcase-cta { align-items: flex-start; flex-direction: column; margin-top: 40px; }
  .showcase-cta-btn { width: 100%; }
}

/* 登录弹窗使用与 landing 一致的黑白主色，不再出现孤立蓝色按钮 */
.saas-auth #btn-saas-login,
.saas-auth #btn-saas-register {
  min-height: 40px;
  border-radius: 8px;
  font-size: 12px;
}
.saas-auth #btn-saas-login {
  border-color: #17181a;
  background: #17181a;
  color: #fff;
}
.saas-auth #btn-saas-register {
  border-color: #d9d3c5;
  background: #fffdf8;
  color: #17181a;
}

/* SaaS auth: confirm field, inline errors, loading state */
.saas-auth .field[hidden] { display: none !important; }

.saas-error {
  margin: 2px 0 12px;
  padding: 9px 11px;
  border: 1px solid #e7b6ae;
  border-radius: 7px;
  background: #fff4f1;
  color: #b3261e;
  font-size: 11.5px;
  line-height: 1.55;
}

.saas-error[hidden] { display: none !important; }

.saas-auth[aria-busy="true"] input,
.saas-auth[aria-busy="true"] .mode-tab {
  opacity: 0.65;
}

.saas-auth .btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* hidden 必须压过 .btn 的 display，否则注册时“登录”按钮仍会露出 */
.saas-auth .btn[hidden],
.saas-auth .mode-tab[hidden] { display: none !important; }

.saas-auth #btn-saas-register {
  border-color: #17181a;
  background: #17181a;
  color: #fff;
}
