.script-editor-shell {
  --bg: #0e1411; --panel: #17201b; --soft: #111815; --border: #294233;
  --text: #d9e7dc; --muted: #8da395; --accent: #7ddf9b; --danger: #ef8d8d;
  height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) 130px;
  color-scheme: dark; background: var(--bg); color: var(--text);
  font: 400 14px/1.5 "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
.script-editor-shell, .script-editor-shell * { box-sizing: border-box; }
.script-editor-shell button, .script-editor-shell input { font: inherit; letter-spacing: normal; }
.script-editor-shell button {
  min-height: 34px; border: 1px solid var(--border); border-radius: 6px; padding: 0 12px;
  background: var(--panel); color: var(--text); cursor: pointer; white-space: nowrap;
}
.script-editor-shell button:hover { border-color: var(--accent); color: var(--accent); }
.script-editor-shell button:disabled { opacity: .45; cursor: default; }
.script-editor-shell button:focus-visible, .script-editor-shell input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.script-editor-shell .se-primary { background: var(--accent); color: #102016; border-color: var(--accent); }
.script-editor-shell .se-primary:hover { color: #102016; }
.script-editor-shell .se-danger { color: var(--danger); }
.script-editor-shell .se-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--panel); }
.script-editor-shell h1 { margin: 0 auto 0 0; font-size: 17px; font-weight: 400; }
.script-editor-shell h2 { margin: 0; font-size: 14px; font-weight: 400; }
.script-editor-shell .se-status { color: var(--muted); font-size: 12px; }
.script-editor-shell .se-workspace { min-height: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.script-editor-shell .se-sidebar { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--panel); }
.script-editor-shell .se-section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px; border-bottom: 1px solid var(--border); }
.script-editor-shell .se-list { min-height: 0; overflow: auto; padding: 8px; display: grid; align-content: start; gap: 6px; }
.script-editor-shell .se-list-item { width: 100%; text-align: left; padding: 9px; display: grid; gap: 3px; white-space: normal; overflow-wrap: anywhere; }
.script-editor-shell .se-list-item.active { border-color: var(--accent); }
.script-editor-shell .se-list-item small { color: var(--muted); font-size: 12px; }
.script-editor-shell .se-main { min-height: 0; min-width: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; background: var(--soft); }
.script-editor-shell .se-meta { display: grid; grid-template-columns: minmax(160px, 240px) minmax(220px, 1fr); gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.script-editor-shell label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.script-editor-shell input { width: 100%; min-width: 0; min-height: 36px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
.script-editor-shell .se-hint { margin: 0; padding: 8px 12px; color: var(--muted); font-size: 12px; }
.script-editor-shell .se-commands { min-height: 0; overflow: hidden; }
.script-editor-shell .cm-editor { height: 100%; font-size: 13px; }
.script-editor-shell .cm-scroller { overflow: auto; font-family: "Cascadia Code", "Consolas", monospace; }
.script-editor-shell .se-diagnostics { min-height: 42px; max-height: 90px; overflow: auto; padding: 8px 12px; border-top: 1px solid var(--border); color: var(--muted); font: 12px/1.5 "Cascadia Code", "Consolas", monospace; white-space: pre-wrap; }
.script-editor-shell .se-diagnostics.error, .script-editor-shell .se-diagnostics.err { color: var(--danger); }
.script-editor-shell .se-footer { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); border-top: 1px solid var(--border); background: #0b100d; }
.script-editor-shell .se-output-head { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.script-editor-shell .se-output-head > span { margin-right: auto; }
.script-editor-shell .se-output { margin: 0; padding: 10px 12px; overflow: auto; color: #b9cabe; font: 12px/1.5 "Cascadia Code", "Consolas", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .script-editor-shell .se-workspace { grid-template-columns: 1fr; grid-template-rows: 130px minmax(0, 1fr); }
  .script-editor-shell .se-sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
  .script-editor-shell .se-list { grid-auto-flow: column; grid-auto-columns: 170px; overflow-x: auto; }
}
@media (max-width: 520px) {
  .script-editor-shell { min-height: 780px; }
  .script-editor-shell h1 { width: 100%; }
  .script-editor-shell .se-meta { grid-template-columns: 1fr; }
}
