  :root {
    --lab-bg: #eef2f7;
    --lab-panel: #ffffff;
    --lab-panel-soft: #f8fafc;
    --lab-border: #dbe3ef;
    --lab-ink: #182235;
    --lab-muted: #66758a;
    --lab-brand: #4f46e5;
    --lab-brand-strong: #4338ca;
    --lab-good: #059669;
    --lab-warn: #f59e0b;
  }
  *{box-sizing:border-box}
  html,body{height:100%;margin:0}
  body{display:flex;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",Arial,sans-serif;background:var(--lab-bg);font-size:14px;color:var(--lab-ink);line-height:1.5}
  #left{flex:2;display:flex;flex-direction:column;min-width:0;background:var(--lab-panel);box-shadow:2px 0 18px rgba(15,23,42,0.08)}
  #editor{flex:1;border-right:1px solid var(--lab-border);min-height:260px}
  #editor .monaco-editor{font-size:14px!important}
  #controls{padding:12px 14px;background:linear-gradient(180deg,#ffffff 0%,#f8fafc 100%);border-bottom:1px solid var(--lab-border);font-size:13px;display:flex;flex-wrap:wrap;align-items:center;gap:9px}
  #controls label{display:inline-flex;align-items:center;gap:5px;font-size:13px;color:#475569;font-weight:600;background:#fff;border:1px solid #e2e8f0;border-radius:999px;padding:4px 8px;min-height:32px}
  #controls button,#controls input,#controls select{font-size:13px}
  button{padding:7px 13px;background:linear-gradient(135deg,var(--lab-brand),#7c3aed);color:white;border:none;border-radius:9px;cursor:pointer;transition:transform 0.18s ease,box-shadow 0.18s ease,background 0.2s;font-weight:700;letter-spacing:0.01em;box-shadow:0 8px 18px -12px rgba(79,70,229,0.75)}
  button:hover{background:linear-gradient(135deg,var(--lab-brand-strong),#6d28d9);transform:translateY(-1px);box-shadow:0 12px 22px -14px rgba(79,70,229,0.85)}
  button:active{transform:translateY(0)}
  button:disabled{background:#94a3b8;cursor:not-allowed;transform:none;box-shadow:none}
  #stopBtn{background:linear-gradient(135deg,#dc2626,#f43f5e)}
  #resetBtn{background:linear-gradient(135deg,#475569,#334155)}
  input,select{padding:5px 7px;border:1px solid #cbd5e1;border-radius:7px;max-width:92px;background:#fff;color:#1e293b;outline:none}
  input:focus,select:focus{border-color:#818cf8;box-shadow:0 0 0 3px rgba(99,102,241,0.16)}
  input[type="range"]{max-width:120px;padding:0;border:none;box-shadow:none}
  #right{flex:2;display:flex;flex-direction:column;min-width:0;padding:12px;background:var(--lab-bg);gap:12px}
  #board,#piPlot{flex:1;width:100%;height:100%;background:white;border:1px solid var(--lab-border);border-radius:10px;box-shadow:0 14px 32px -28px rgba(15,23,42,0.45)}
  .chart-container{position:relative;margin-bottom:15px}
  .chart-title{position:relative;top:10px;left:0px;font-weight:700;color:#334155;background:rgba(255,255,255,0.88);padding:5px 10px;border-radius:7px;border:1px solid rgba(226,232,240,0.85)}
  h2{font-size:15px;font-weight:800;color:#334155;padding:12px 14px;margin:0;background:linear-gradient(180deg,#ffffff,#f8fafc);text-align:center;letter-spacing:0.01em;border-bottom:1px solid var(--lab-border)}
  #hist,#trace{flex:1;width:100%;height:80%;background:white;border:1px solid var(--lab-border);border-radius:10px;box-shadow:0 14px 32px -28px rgba(15,23,42,0.45)}
  .y-range{ display: none;position:absolute;top:10px;right:10px;font-size:12px;color:#495057;background:rgba(255,255,255,0.9);padding:4px 8px;border-radius:7px;border:1px solid rgba(226,232,240,0.85)}
  /* 参数说明小字 */

.param-tip {
    margin-left: 0.3em;
    color: #94a3b8;
    font-size: 0.85em;
    cursor: help;
}
.param-tip:hover {
    color: #4f46e5;
}

/* 分布一句话说明 */
.dist-desc {
    margin: 8px 12px 0;
    padding: 6px 10px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    background: #f8fafc;
    border-left: 2px solid #c7d2fe;
    border-radius: 2px;
}
#output{flex:1;width:100%;height:100%;background:white;border:1px solid var(--lab-border);border-radius:10px;box-shadow:0 14px 32px -28px rgba(15,23,42,0.45)}

/* 函数说明区域 */
.func-desc {
  background-color: #e8f4fc;
  /* padding: 12px; */
  border-radius: 6px;
  /* margin-bottom: 20px; */
  font-size: 14px;
  border-left: 4px solid #3498db;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 8px;
}

#progressContainer {
  margin-top: 5px;
}

#progressBar {
  width: 100%;
  height: 10px;
  background-color: #ecf0f1;
  border-radius: 5px;
  overflow: hidden;
}

#progress {
  height: 100%;
  background-color: #2ecc71;
  width: 0%;
  transition: width 0.3s;
}

#result {
  margin-top: 5px;
  padding: 10px;
  background-color: #e8f8f5;
  border-radius: 6px;
  border-left: 4px solid #2ecc71;
  font-size: 14px;
}

@media (max-width: 880px) {
  body{display:block;overflow:auto}
  #left,#right{min-height:560px}
  #controls{position:sticky;top:0;z-index:10}
}
