* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 24px;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f6f7f9;
  color: #24292f;
}

header h1 {
  margin: 0 0 8px;
  font-size: 22px;
}

.header-row {
  display: flex;
  align-items: baseline;
  gap: 24px;
}

.header-row h1 {
  margin: 0;
  white-space: nowrap;
}

.subtitle {
  margin: 0 0 16px;
  color: #57606a;
  font-size: 13px;
  line-height: 1.8;
}

.legend-note {
  padding: 1px 6px;
  border-radius: 4px;
}

.note-blue {
  color: #2563eb;
  background: #eff6ff;
}

.note-orange {
  color: #c2410c;
  background: #fff7ed;
}

.note-red {
  color: #b91c1c;
  background: #fef2f2;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  margin-bottom: 16px;
}

.control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control label {
  font-size: 14px;
  white-space: nowrap;
}

.control input[type="number"] {
  width: 72px;
  padding: 4px 6px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 14px;
}

.control-mc {
  flex-wrap: wrap;
}

button {
  padding: 4px 12px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #f6f8fa;
  font-size: 13px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: #eaeef2;
}

button:disabled {
  color: #8c959f;
  cursor: not-allowed;
}

select {
  padding: 3px 6px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 13px;
}

main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.chart-wrap {
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 12px;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-bottom: 4px;
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
}

.op-radios {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  font-size: 13px;
  color: #374151;
}

.op-radios label {
  white-space: nowrap;
  cursor: pointer;
}

.radio-hint {
  color: #8c959f;
  font-size: 12px;
}

.panel-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 10px;
  margin: 4px 0 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
}

.panel-controls:empty {
  display: none;
}

.panel-controls label {
  font-size: 13px;
  white-space: nowrap;
}

.panel-controls input[type="number"] {
  width: 72px;
  padding: 3px 6px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 13px;
}

.panel-controls input[type="range"] {
  width: 180px;
}

.controls-hint {
  font-size: 12px;
  color: #8c959f;
}

/* 采样按钮：样本失效/未采样时高亮提示 */
button.need-sample {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

button.need-sample:hover:not(:disabled) {
  background: #1d4ed8;
}

.stat-dim {
  color: #8c959f;
}

.chart {
  width: 100%;
  height: 420px;
}

.chart-note {
  margin: 8px 4px 0;
  font-size: 12px;
  color: #57606a;
  line-height: 1.6;
}

/* 面板一函数勾选 chip：色点 + 名称 */
.fn-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  width: 100%;
}

.fn-checks label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  cursor: pointer;
}

.fn-checks .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

/* 参数滑块行（两面板共用样式） */
.param-row .control-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.param-row input[type="range"] {
  width: 140px;
}

.param-row input[type="number"] {
  width: 64px;
}

/* 面板三：热力图与切片并排 */
.glu-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.chart-heat {
  height: 400px;
}

.slice-radios {
  margin: 4px 0;
}

@media (max-width: 1100px) {
  .glu-row {
    grid-template-columns: 1fr;
  }
}

/* 模型-激活对照表 */
.model-table {
  margin: 12px 4px 4px;
  border-collapse: collapse;
  font-size: 12px;
  color: #374151;
}

.model-table th,
.model-table td {
  border: 1px solid #e2e8f0;
  padding: 5px 12px;
  text-align: left;
}

.model-table th {
  background: #f8fafc;
  font-weight: 600;
}
