/* EconModel Lab —— 组件样式（全部 .econmodel-* 作用域，不污染站点主题） */
.econmodel-embed {
  border: 1px solid #e7e3da;
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px 14px;
  margin: 14px 0;
}
.econmodel-embed-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 14px; font-weight: 600; color: #1f2937; margin-bottom: 8px;
}
.econmodel-embed-header .em-title { display: inline-flex; align-items: center; gap: 6px; }
.econmodel-open-lab {
  font-size: 12.5px; font-weight: 600; color: #2563eb;
  text-decoration: none; white-space: nowrap; padding: 4px 10px;
  border: 1px solid #cfe0ff; border-radius: 999px; background: #f3f8ff;
  transition: background .15s;
}
.econmodel-open-lab:hover { background: #e2eeff; }
.econmodel-plot { width: 100%; height: 380px; }
/* 画布高度随视口收缩，使三栏等高、底部对齐，主页面不再纵向滚动 */
.econmodel-plot-lg { height: 100%; min-height: 340px; }

/* 控件面板 */
.econmodel-controls { margin-top: 10px; }
.econmodel-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; }
.em-slider label { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: #475569; margin-bottom: 2px; }
.em-slider .em-val { font-variant-numeric: tabular-nums; color: #111; font-weight: 600; }
/* 滑块与数值框同一行，避免独占一行白吃高度 */
.em-slider { display: grid; grid-template-columns: minmax(0,1fr) 66px; grid-template-areas: "lab lab" "range num"; align-items: center; column-gap: 8px; row-gap: 2px; }
.em-slider label { grid-area: lab; }
.em-slider input[type=range] { grid-area: range; width: 100%; accent-color: #2563eb; }
.em-slider .em-num {
  grid-area: num; width: 66px; padding: 3px 6px; font-size: 12px;
  border: 1px solid #d8d3c8; border-radius: 7px; text-align: right;
}
.econmodel-presets { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.em-preset {
  font-size: 12.5px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid #d8d3c8; background: #faf8f4; color: #334155; transition: .15s;
}
.em-preset:hover { background: #f0ece3; border-color: #c2bba9; }
.econmodel-tools { display: flex; gap: 8px; margin-top: 12px; }
.em-btn {
  font-size: 12.5px; padding: 6px 14px; border-radius: 9px; cursor: pointer;
  border: 1px solid #cfe0ff; background: #f3f8ff; color: #1d4ed8; transition: .15s;
}
.em-btn:hover { background: #e2eeff; }

/* 状态占位 */
.econmodel-missing, .econmodel-error { padding: 18px; text-align: center; color: #94a3b8; font-size: 13px; }
.econmodel-error { color: #b91c1c; }

/* 收益矩阵 */
.em-matrix-wrap { padding: 10px 4px; }
.em-payoff { border-collapse: collapse; margin: 0 auto; font-size: 14px; }
.em-payoff th, .em-payoff td { border: 1px solid #d8d3c8; padding: 12px 18px; text-align: center; min-width: 84px; }
.em-payoff th { background: #f5f2ea; color: #475569; font-weight: 600; }
.em-payoff td br { line-height: 1.1; }
.em-payoff td.ne { background: #fff4d6; outline: 2px solid #f59e0b; font-weight: 700; }   /* 纳什均衡 */
.em-payoff td.br { background: #eafaf0; }   /* 行方最优反应 */
.em-payoff td.bc { background: #eef3ff; }   /* 列方最优反应 */
.em-matrix-note { max-width: 520px; margin: 12px auto 0; font-size: 12.5px; color: #64748b; line-height: 1.6; }

/* 集成徽标（kb 列表项旁） */
.econmodel-badge {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 6px;
  font-size: 11px; font-weight: 600; color: #b45309;
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: 999px; padding: 1px 7px;
  text-decoration: none; vertical-align: middle;
}
.econmodel-badge:hover { background: #ffedd5; }

.em-preset.active { background: #e2eeff; border-color: #93b8ff; color: #1d4ed8; font-weight: 600; }

@media (max-width: 560px) {
  .econmodel-sliders { grid-template-columns: 1fr; }
  .econmodel-plot { height: 340px; }
  .econmodel-plot-lg { height: 470px; }
}
