:root {
    --bg: #0f1220;
    --panel: #161a2e;
    --panel2: #1b2040;
    --text: #e8ebff;
    --muted: #aab0d6;
    --border: rgba(255, 255, 255, .10);
    --accent: #7aa2ff;
    --danger: #ff6b6b;
    --ok: #54d18d;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans JP", sans-serif;
    background: var(--bg);
    color: var(--text);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0));
}

.topbar h1 {
    font-size: 16px;
    margin: 0 16px 0 0;
}

.topbar__left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.status {
    font-size: 12px;
    color: var(--muted);
}

.layout {
    display: flex;
    height: calc(100% - 54px);
}

.sidebar {
    width: 340px;
    border-right: 1px solid var(--border);
    padding: 12px;
    overflow: auto;
}

.content {
    flex: 1;
    padding: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}


.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.panel--editor {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.panel--preview {
    flex: 0 0 500px;
    /* 例：280px固定 */
    min-height: 200px;
    display: flex;
    flex-direction: column;
}


.panel__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--panel2);
    border-bottom: 1px solid var(--border);
}

.panel__body {
    padding: 12px;
    overflow: auto;
    min-height: 500px;
}

.panel__head h2 {
    font-size: 14px;
    margin: 0;
}

.panel__sub {
    font-size: 12px;
    color: var(--muted);
}

.btn {
    appearance: none;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .06);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

.btn:hover {
    border-color: rgba(255, 255, 255, .22);
}

.btn--primary {
    background: rgba(122, 162, 255, .18);
    border-color: rgba(122, 162, 255, .45);
}

.btn--ghost {
    background: transparent;
}

.btn--small {
    padding: 6px 8px;
    font-size: 12px;
}

.stepList {
    display: flex;
    flex-direction: column;
}

.stepItem {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.stepItem:hover {
    background: rgba(255, 255, 255, .04);
}

.stepItem--active {
    background: rgba(122, 162, 255, .12);
}

.stepItem__meta {
    display: flex;
    flex-direction: column;
}

.stepItem__id {
    font-size: 12px;
    color: var(--muted);
}

.stepItem__text {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.list {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.listItem {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, .03);
}

.row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 10px;
    align-items: center;
}

.row label {
    font-size: 12px;
    color: var(--muted);
}

input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, .25);
    color: var(--text);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

.editor {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.block {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, .03);
}

.block__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.block__head h3 {
    margin: 0;
    font-size: 13px;
}

.block__actions {
    display: flex;
    gap: 8px;
}

.hint {
    color: var(--muted);
    font-size: 13px;
    padding: 18px;
    text-align: center;
}

.jsonPreview {
    width: 100%;
    height: 100%;
    min-height: 0;
    resize: none;
}

.validation {
    margin: 0;
    padding: 10px 18px;
    color: var(--muted);
    font-size: 12px;
}

.validation li.ok {
    color: var(--ok);
}

.validation li.ng {
    color: var(--danger);
}