  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; overflow: hidden; }
  body {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: #0f172a; color: #e2e8f0;
    display: flex; flex-direction: column;
  }

  /* ===== 顶栏 ===== */
  .header {
    padding: 8px 16px; background: #1e293b; border-bottom: 1px solid #334155;
    display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
  }
  .header h1 { font-size: 16px; color: #38bdf8; }
  .header .sub { font-size: 12px; color: #64748b; }
  .header-right { display: flex; align-items: center; gap: 12px; }
  .header-right .tag {
    padding: 3px 10px; border-radius: 4px; font-size: 11px;
    background: #1e3a5f; color: #93c5fd;
  }

  /* ===== 主体 ===== */
  .main-wrap { flex: 1; display: flex; min-height: 0; }

  /* ===== 左侧：指令输入 ===== */
  .editor-panel {
    width: 360px; min-width: 280px; background: #0f172a;
    border-right: 1px solid #334155; display: flex; flex-direction: column;
  }
  /* CodeMirror 已移除 */
  .editor-header {
    padding: 8px 12px; background: #1e293b; border-bottom: 1px solid #334155;
    display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
  }
  .editor-header span { font-size: 11px; color: #94a3b8; }
  .editor-actions { display: flex; gap: 6px; }
  .editor-wrap { flex: 1; position: relative; min-height: 0; }
  #fpCode, #fpHighlighter {
    position: absolute; inset: 0; padding: 12px 14px;
    font-family: inherit; font-size: 14px; line-height: 1.7; tab-size: 2;
    overflow: auto; white-space: pre-wrap; word-wrap: break-word;
    border: none; outline: none; resize: none;
  }
  #fpCode {
    z-index: 2; background: transparent; color: transparent;
    caret-color: #e2e8f0;
  }
  #fpCode::placeholder { color: #475569; }
  #fpHighlighter { z-index: 1; pointer-events: none; background: #0f172a; }
  .editor-footer {
    padding: 6px 12px; background: #1e293b; border-top: 1px solid #334155;
    display: flex; gap: 6px; align-items: center; flex-shrink: 0;
  }

  /* ===== 中间：渲染区 ===== */
  .canvas-wrap {
    flex: 1; display: flex; flex-direction: column; min-width: 0; background: #0f172a;
  }
  #canvas-container {
    flex: 1; position: relative; overflow: hidden;
    background: #0c1222; margin: 8px; border-radius: 8px;
  }

  /* ===== 右侧：工具栏 ===== */
  .toolbar {
    width: 240px; background: #1e293b; border-left: 1px solid #334155;
    padding: 16px 14px; overflow-y: auto; flex-shrink: 0;
  }
  .toolbar .section { margin-bottom: 16px; }
  .toolbar .section-title {
    font-size: 11px; color: #64748b; font-weight: 600;
    margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px;
  }
  .toolbar .row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
  .toolbar .row label { font-size: 12px; color: #94a3b8; min-width: 26px; }
  .toolbar input, .toolbar select {
    padding: 5px 8px; border: 1px solid #334155; border-radius: 4px;
    font-size: 12px; background: #0f172a; color: #e2e8f0; outline: none;
  }
  .toolbar input:focus, .toolbar select:focus { border-color: #3b82f6; }
  .toolbar input[type="number"] { width: 64px; }
  .toolbar input[type="color"] { width: 34px; height: 26px; padding: 2px; border: none; cursor: pointer; background: transparent; }
  .toolbar select { flex: 1; }
  .toolbar .divider { height: 1px; background: #334155; margin: 12px 0; }

  .toolbar button {
    padding: 6px 10px; border: 1px solid #334155; border-radius: 4px;
    cursor: pointer; font-size: 11px; background: #0f172a; color: #94a3b8;
    transition: all 0.15s; line-height: 1.4;
  }
  .toolbar button:hover { background: #1e293b; color: #e2e8f0; border-color: #475569; }
  .toolbar .btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
  .toolbar .btn-primary:hover { background: #3b82f6; }

  /* 原点按钮 */
  .origin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .origin-btn {
    padding: 6px 2px; border: 1px solid #334155; border-radius: 4px;
    background: #0f172a; cursor: pointer; font-size: 10px; text-align: center;
    color: #64748b; transition: all 0.15s;
  }
  .origin-btn:hover { border-color: #3b82f6; color: #93c5fd; }
  .origin-btn.active { border-color: #3b82f6; background: #1e3a5f; color: #93c5fd; }
  .origin-btn .icon { font-size: 14px; display: block; }

  /* ===== 底部信息区 ===== */
  .info-bar {
    height: 150px; background: #1e293b; border-top: 1px solid #334155; position: relative;
    display: flex; flex-shrink: 0; overflow: hidden;
  }
  .info-tabs {
    width: 64px; background: #0f172a; border-right: 1px solid #334155;
    display: flex; flex-direction: column; padding: 6px 0;
  }
  .info-tab {
    padding: 8px 4px; font-size: 10px; text-align: center; cursor: pointer;
    color: #64748b; border-left: 2px solid transparent; line-height: 1.3;
  }
  .info-tab:hover { color: #94a3b8; background: #1e293b; }
  .info-tab.active { color: #38bdf8; border-left-color: #38bdf8; background: #1e293b; }
  .info-content {
    flex: 1; padding: 10px 14px; overflow-y: auto; font-size: 13px;
    position: relative;
  }
  .info-actions { margin-right: 24px;
    position: absolute; bottom: 6px; right: 8px; display: flex; gap: 4px; z-index: 2;
  }
  .info-actions button {
    padding: 2px 8px; border: 1px solid #334155; border-radius: 3px;
    background: #0f172a; color: #64748b; cursor: pointer; font-size: 10px;
    transition: all 0.15s;
  }
  .info-actions button:hover { color: #94a3b8; border-color: #475569; }
  .info-content .err { color: #f87171; padding: 2px 0; }
  .info-content .ok { color: #6ee7b7; }
  .info-content .info { color: #94a3b8; }
  .info-bar-actions { position: absolute; right: 32px; top: 4px; z-index: 10; display: flex; gap: 4px; }
  .info-content .warn { color: #fbbf24; }
  .info-item { padding: 3px 0; border-bottom: 1px solid #1e293b; }
  .info-item .line-num { color: #475569; margin-right: 8px; }

  .editor-panel { height: 100%; }
