* {
  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-slider {
  flex: 1 1 300px;
}

.control-slider input[type="range"] {
  flex: 1;
  width: auto;
  min-width: 160px;
}

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

#inputSigma2 {
  width: 96px;
}

.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;
}

/* σ² 预设按钮组：连成一体，选中高亮 */
.preset-group {
  display: flex;
}

.preset-group button {
  border-radius: 0;
  margin-left: -1px;
}

.preset-group button:first-child {
  border-radius: 6px 0 0 6px;
  margin-left: 0;
}

.preset-group button:last-child {
  border-radius: 0 6px 6px 0;
}

.preset-group button.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  position: relative;
}

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 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;
}

/* 面板参数行内的控件小组（如头维 H：标签+滑块+输入框），可整体隐藏 */
.panel-controls .control-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.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;
}
