/* 代码编辑器（js/core/editor.js）：透明的 textarea 叠在高亮层上，两层的字体、行高、内边距必须一模一样 */
.editor {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
}
.editor-body { position: relative; display: flex; flex: 1; min-height: 320px; overflow: hidden; }
.editor-gutter {
  flex: none;
  min-width: 44px;
  margin: 0;
  padding: 12px 8px 12px 12px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  color: var(--code-gutter);
  font: 13px/1.6 var(--font-mono);
  text-align: right;
  user-select: none;
}
.editor-stage { position: relative; flex: 1; min-width: 0; }
.editor-hl, .editor-input {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
  border: 0;
  font: 13px/1.6 var(--font-mono);
  letter-spacing: 0;
  white-space: pre;
  tab-size: 4;
  scrollbar-gutter: stable;
}
.editor-hl { overflow: hidden; color: var(--ink); pointer-events: none; }
.editor-input {
  resize: none;
  outline: none;
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: var(--ink);
}
.editor-input::selection { background: rgb(44 90 69 / 28%); }
.editor.is-wrap .editor-hl, .editor.is-wrap .editor-input { white-space: pre-wrap; overflow-wrap: anywhere; }
.editor.is-wrap .editor-gutter { display: none; }
.editor.is-readonly .editor-input { cursor: default; }
.find-hit { border-radius: 2px; background: rgb(242 180 28 / 35%); color: inherit; }
.find-hit.is-current { background: var(--signal); box-shadow: 0 0 0 1px var(--signal); }
.editor-find {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--sheet);
}
.editor-find[hidden] { display: none; }
.editor-find-input {
  width: 170px;
  padding: 4px 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--sheet);
  color: var(--ink);
  font: 12.5px var(--font-mono);
}
.editor-find-count { min-width: 48px; color: var(--ink-3); font-size: 12px; }
.editor-find-btn {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sheet-2);
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}
.editor-status {
  display: flex;
  gap: 14px;
  padding: 4px 10px;
  border-top: 1px solid var(--line);
  background: var(--sheet);
  color: var(--ink-3);
  font-size: 12px;
}
.editor-state { margin-left: auto; color: var(--warn-ink); }
