/* MixOS 课程仿真实验 — 样式 */
.sim-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbfc;
  padding: 1rem;
  margin-top: 0.75rem;
}

.sim-title {
  font-weight: 600;
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.sim-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.sim-controls button,
.sim-controls select,
.sim-controls input[type="range"] {
  font: inherit;
  font-size: 0.85rem;
}

.sim-controls button {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.sim-controls button:hover { background: var(--accent-soft); }
.sim-controls button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.sim-controls button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sim-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: #eef4fa;
  border-radius: 8px;
  margin: 0.5rem 0;
}

.sim-svg-stage {
  background: #eef4fa;
  border-radius: 12px;
  overflow: hidden;
  margin: 0.35rem 0 0.65rem;
  border: 1px solid #dbe4ee;
}
.sim-live-svg {
  display: block;
  width: 100%;
  height: auto;
}
.sim-live-svg .sim-tok {
  transition: cx 0.4s ease, cy 0.4s ease;
}

.sim-log {
  font-family: Consolas, "Cascadia Code", monospace;
  font-size: 0.8rem;
  background: #f1f5f9;
  color: #0f172a;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  max-height: 140px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin-top: 0.5rem;
}

.sim-panel {
  display: grid;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.sim-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.sim-layer {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  text-align: center;
  min-width: 5rem;
}

.sim-layer.active {
  border-color: var(--accent);
  transform: scale(1.03);
  box-shadow: 0 2px 8px rgba(9, 105, 218, 0.2);
}

.sim-layer.done { border-color: var(--ok); background: #f6ffed; }

.sim-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
}

.sim-dropzone {
  min-height: 3rem;
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  background: #fff;
}

.sim-dropzone.over { border-color: var(--accent); background: var(--accent-soft); }

.sim-chip {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: grab;
  user-select: none;
}

.sim-terminal {
  font-family: Consolas, monospace;
  font-size: 0.85rem;
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem;
  min-height: 6rem;
}

.sim-terminal input {
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  outline: none;
  width: 70%;
}

.sim-bar {
  height: 1.25rem;
  border-radius: 4px;
  background: #eaeef2;
  overflow: hidden;
  flex: 1;
  min-width: 120px;
}

.sim-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.2s;
}

.sim-gantt {
  display: flex;
  height: 2rem;
  border-radius: 6px;
  overflow: hidden;
  margin: 0.25rem 0;
  border: 1px solid var(--border);
}

.sim-gantt-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  min-width: 2px;
}

.sim-state {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.sim-state.run { background: #dafbe1; color: var(--ok); }
.sim-state.ready { background: #fff8c5; color: var(--pending); }
.sim-state.block { background: #ffebe9; color: #cf222e; }

.tag-sim { background: #ddf4ff; color: #0550ae; }

.exp-steps {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
}

.exp-steps li { margin-bottom: 0.25rem; }

/* —— 分层调用 / 探查 —— */
.sim-callflow {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 0.75rem;
  margin: 0.5rem 0;
  align-items: start;
}
@media (max-width: 720px) {
  .sim-callflow { grid-template-columns: 1fr; }
}

.sim-call-stack .sim-layer {
  text-align: left;
}
.sim-layer-name {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.sim-layer-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: #0550ae;
  background: #ddf4ff;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  white-space: nowrap;
}
.sim-layer.returning {
  border-color: #8250df;
  background: #fbefff;
}
.sim-path {
  font-family: Consolas, "Cascadia Code", monospace;
  font-size: 0.8rem;
  color: #57606a;
  margin: 0.35rem 0;
  padding: 0.35rem 0.5rem;
  background: #f6f8fa;
  border-radius: 6px;
}
.sim-detail {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0.65rem 0.75rem;
  font-size: 0.88rem;
  min-height: 6rem;
}
.sim-detail p { margin: 0.4rem 0 0; }
.sim-calls { color: #1f2328; }
.sim-dump {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.65rem;
  background: #f1f5f9;
  color: #0f172a;
  border-radius: 6px;
  font-size: 0.78rem;
  overflow-x: auto;
}

.sim-explore {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.45rem;
  margin: 0.5rem 0;
}
.sim-explore-card {
  text-align: left;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  font: inherit;
}
.sim-explore-card small {
  display: block;
  color: #57606a;
  margin-top: 0.2rem;
  font-size: 0.75rem;
}
.sim-explore-card:hover { border-color: var(--accent); }
.sim-explore-card.active {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(9, 105, 218, 0.18);
}
.sim-explore-card.done { background: #f6ffed; border-color: var(--ok); }

.sim-states {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}
.sim-state-node {
  flex: 1;
  min-width: 6.5rem;
  padding: 0.55rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}
.sim-state-node small {
  display: block;
  color: #57606a;
  margin-top: 0.2rem;
  font-size: 0.75rem;
}
.sim-state-node.active {
  border-color: var(--accent);
  background: #ddf4ff;
  transform: scale(1.02);
}

.sim-precede-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.35rem 0;
  flex-wrap: wrap;
}
.sim-arrow { color: #0969da; font-weight: 700; }

.sim-bitrow {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}
.sim-bit {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #dafbe1;
  border: 1px solid #4ac26b;
  font-size: 0.75rem;
  font-weight: 700;
}
.sim-bit.used {
  background: #ffebe9;
  border-color: #ff8182;
  color: #cf222e;
}

.ppt-live-svg [data-step].is-on {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}
.ppt-live-svg circle.is-on {
  stroke: #f59e0b;
  stroke-width: 4;
}

.sim-linux-note {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  color: #64748b;
}
.sim-linux-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.55rem;
}
.sim-linux-hints button {
  font: inherit;
  font-size: 0.75rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
}
.sim-linux-hints button:hover {
  background: #e2e8f0;
}
.sim-linux-hints .sim-linux-reset {
  margin-left: auto;
  border-color: #94a3b8;
}
.sim-linux {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #1e293b;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.sim-linux-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: #1e293b;
  color: #cbd5e1;
  font-size: 0.75rem;
  padding: 0.4rem 0.75rem;
}
.sim-linux-dots {
  display: inline-flex;
  gap: 6px;
}
.sim-linux-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
}
.sim-linux-dots i:nth-child(1) { background: #f87171; }
.sim-linux-dots i:nth-child(2) { background: #fbbf24; }
.sim-linux-dots i:nth-child(3) { background: #34d399; }
.sim-linux-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sim-linux-screen {
  background: #0b1220;
  color: #e2e8f0;
  min-height: 280px;
  max-height: 380px;
  overflow-y: auto;
  padding: 0.7rem 0.9rem 0.55rem;
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 0.84rem;
  line-height: 1.45;
  cursor: text;
}
.sim-linux-out {
  white-space: pre-wrap;
  word-break: break-word;
}
.sim-linux-line {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}
.sim-linux-ps {
  color: #4ade80;
  font-weight: 600;
  white-space: nowrap;
}
.sim-linux-line input {
  flex: 1;
  min-width: 4rem;
  background: transparent;
  border: none;
  color: #f8fafc;
  font: inherit;
  outline: none;
  caret-color: #4ade80;
}
