  :root {
    --bg: #f7f8fa;
    --panel: #ffffff;
    --border: #e3e6eb;
    --text: #1f2329;
    --muted: #8a9099;
    --accent: #2f6fed;
    --accent-hover: #2559c9;
    --ok: #1a9c5b;
    --err: #d93a3a;
  }
  * { box-sizing: border-box; }
  html, body { height: 100%; margin: 0; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
  }
  header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
  }
  .brand { font-size: 16px; font-weight: 600; margin-right: auto; }
  button {
    font: inherit;
    font-size: 13px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
  }
  button:hover { border-color: #c4c9d0; }
  button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
  button.primary:hover { background: var(--accent-hover); }
  button:disabled { opacity: .5; cursor: not-allowed; }
  .status { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; min-width: 96px; }
  .dot { width: 8px; height: 8px; border-radius: 50%; background: #d0a020; }
  .dot.ready { background: var(--ok); }
  .dot.busy { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
  main { flex: 1; display: flex; min-height: 0; }
  .pane { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
  .pane + .pane { border-left: 1px solid var(--border); }
  .pane-title {
    font-size: 12px; color: var(--muted);
    padding: 8px 14px; border-bottom: 1px solid var(--border);
    background: var(--panel);
  }
  #editor { flex: 1; }
  #output {
    flex: 1;
    overflow: auto;
    padding: 12px 14px;
    background: var(--panel);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
  }
  #output .err { color: var(--err); }
  #output img { display: block; max-width: 100%; margin: 10px 0; border: 1px solid var(--border); border-radius: 4px; }
  #output .empty { color: var(--muted); }
  footer {
    font-size: 11px; color: var(--muted);
    padding: 6px 16px; border-top: 1px solid var(--border);
    background: var(--panel);
  }
  kbd { background: var(--bg); border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; font-size: 11px; }
