:root {
    --bg-main: #f3f4f6;
    --bg-grad-a: #fafafa;
    --bg-grad-b: #eef2f7;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --input: #fcfcfd;
    --border: #e5e7eb;
    --text: #0f172a;
    --muted: #64748b;
    --brand: #111827;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --success: #16a34a;
    --warn: #d97706;
    --danger: #dc2626;
    --line-num: #94a3b8;
    --selection: rgba(79, 70, 229, 0.18);
    --shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
    --card-height: clamp(430px, 68vh, 760px);
    --option-card-height: clamp(390px, 43vh, 530px);
    --font-code: "JetBrains Mono", "Fira Code", "Source Code Pro", Consolas, monospace;
    --font-ui: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

body.theme-dark {
    --bg-main: #11161d;
    --bg-grad-a: #1a212d;
    --bg-grad-b: #10161f;
    --panel: #181f29;
    --panel-soft: #202a36;
    --input: #131a24;
    --border: #2d3a4a;
    --text: #e8eef7;
    --muted: #9fb0c6;
    --brand: #2a7de1;
    --accent: #2a7de1;
    --accent-hover: #1f6dc8;
    --success: #1faa6c;
    --warn: #e09f3e;
    --danger: #d95055;
    --line-num: #607089;
    --selection: rgba(42, 125, 225, 0.3);
    --shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: var(--font-ui);
    color: var(--text);
    background: radial-gradient(circle at 12% 0%, var(--bg-grad-a), var(--bg-main) 42%, var(--bg-grad-b));
}

.app-shell {
    max-width: 1600px;
    margin: 0 auto;
    padding: 14px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--panel) 88%, transparent);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
}

.brand h1 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
    letter-spacing: 0.2px;
}

.brand p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.top-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn,
.mini-btn,
.main-btn {
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.action-btn,
.mini-btn {
    padding: 7px 12px;
    font-size: 12px;
    line-height: 1;
}

.main-btn {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
}

.action-btn:hover,
.mini-btn:hover,
.main-btn:hover {
    border-color: #cbd5e1;
    background: var(--panel-soft);
    transform: translateY(-1px);
}

.mini-btn.is-active {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

#decryptBtn {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

#decryptBtn:hover {
    background: color-mix(in srgb, var(--brand) 90%, #000 10%);
    border-color: color-mix(in srgb, var(--brand) 90%, #000 10%);
}

.workspace-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: stretch;
}

.editor-panel,
.option-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.editor-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    height: var(--card-height);
}

.panel-head {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.panel-head h2 {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.panel-head span {
    color: var(--muted);
    font-size: 12px;
}

.editor-head-meta {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.file-tab {
    border: 1px solid #dbe3ee;
    border-radius: 999px;
    background: #f8fbff;
    color: #475569;
    padding: 5px 10px;
    font: 600 11px/1.2 var(--font-code);
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-tab.result {
    border-color: #dbeafe;
    background: #eff6ff;
    color: #1d4ed8;
}

.run-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.run-dot.ok {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.panel-tools {
    display: flex;
    gap: 7px;
}

.editor-wrap {
    display: grid;
    grid-template-columns: 56px 1fr;
    height: auto;
    min-height: 0;
    flex: 1;
    overflow: hidden;
    border-radius: 0 0 14px 14px;
}

.editor-wrap.is-collapsed {
    height: 0;
    min-height: 0;
    max-height: 0;
    border-top: 0;
}

.editor-collapsed-tip {
    display: none;
    margin: 10px 12px 12px;
    padding: 10px 12px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.editor-wrap.is-collapsed + .editor-collapsed-tip {
    display: flex;
    align-items: center;
}

.line-numbers {
    background: var(--panel-soft);
    color: var(--line-num);
    border-right: 1px solid var(--border);
    padding: 10px 8px 10px 0;
    text-align: right;
    font: 13px/1.65 var(--font-code);
    overflow: hidden;
    user-select: none;
}

.code-layer {
    position: relative;
    background: var(--input);
    overflow: hidden;
    height: 100%;
}

.code-highlight,
.code-input {
    margin: 0;
    min-height: 100%;
    height: 100%;
    width: 100%;
    padding: 10px 12px;
    font: 13px/1.65 var(--font-code);
    white-space: pre;
    tab-size: 4;
}

.code-highlight {
    position: absolute;
    inset: 0;
    color: var(--text);
    pointer-events: none;
    overflow: hidden;
}

.code-input {
    position: relative;
    display: block;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    color: transparent;
    caret-color: var(--text);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.code-input::selection {
    background: var(--selection);
}

.code-input[readonly] {
    cursor: text;
}

.options-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: stretch;
    grid-auto-rows: var(--option-card-height);
}

.option-card {
    padding: 14px 14px 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    height: var(--option-card-height);
}

.option-card h3 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.option-card-config {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    padding-bottom: 8px;
}

.option-card-console {
    padding-bottom: 10px;
}

.option-card-console .terminal-box {
    margin-bottom: 2px;
    box-shadow: none;
}

.config-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.config-subtitle {
    margin: 4px 0 0;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.55;
}

.config-badge {
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font: 700 11px/1 var(--font-code);
    padding: 7px 10px;
    letter-spacing: 0.08em;
}

.config-badge.manual {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.config-kpis {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.kpi-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    padding: 10px 10px 9px;
}

.kpi-item span {
    display: block;
    color: #94a3b8;
    font-size: 11px;
    margin-bottom: 4px;
}

.kpi-item strong {
    display: block;
    font-size: 12px;
    color: #0f172a;
    line-height: 1.3;
}

.config-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 10px;
    min-height: 0;
    align-items: stretch;
}

.config-block {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
}

.config-block h4 {
    margin: 0 0 10px;
    font-size: 12px;
    color: #64748b;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.form-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.form-row.is-hidden {
    display: none;
}

.form-row label {
    color: var(--muted);
    font-size: 12px;
}

.form-row select,
.form-row input {
    width: 100%;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-soft);
    color: var(--text);
    padding: 0 10px;
    outline: none;
}

.form-row select:focus,
.form-row input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(147, 197, 253, 0.25);
}

.captcha-group {
    display: grid;
    grid-template-columns: 1fr 108px;
    gap: 10px;
}

.decode-captcha {
    width: 108px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    cursor: pointer;
    object-fit: cover;
}

.checkbox-row {
    margin-top: 6px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.checkbox-row label {
    font-size: 12px;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.checkbox-pills {
    gap: 8px;
    margin-bottom: 2px;
}

.toggle-pill {
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-pill:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.toggle-pill input {
    accent-color: #4f46e5;
}

.config-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #dbe3ee;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.config-actions .footer-actions {
    margin-bottom: 0;
    flex: 1 1 auto;
}

.config-status-row {
    margin-top: 8px;
    padding-bottom: 2px;
}

.result-tabs {
    display: none;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--panel-soft);
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
}

.result-tabs.is-visible {
    display: flex;
}

.diff-tabs {
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    min-height: 46px;
}

.diff-tabs .result-tab {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    width: max-content;
    min-width: max-content;
    max-width: none !important;
    overflow: visible;
    text-overflow: unset;
    white-space: nowrap;
    font: 600 12px/1.35 var(--font-code);
    padding: 7px 12px;
}

.result-tab {
    border: 1px solid #d8e2ef;
    background: #ffffff;
    color: #475569;
    border-radius: 8px;
    padding: 6px 10px;
    font: 600 11px/1.2 var(--font-code);
    cursor: pointer;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-tab:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
}

.result-tab.active {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

body.theme-dark .option-card-config {
    background: linear-gradient(180deg, #1a2230 0%, #161d29 100%);
}

body.theme-dark .config-subtitle {
    color: #8ea1b9;
}

body.theme-dark .config-badge {
    border-color: #355489;
    background: #1b3761;
    color: #b8d6ff;
}

body.theme-dark .config-badge.manual {
    border-color: #705320;
    background: #3e2f12;
    color: #f9d68a;
}

body.theme-dark .kpi-item,
body.theme-dark .config-block {
    border-color: #2d3a4a;
    background: #1b2431;
}

body.theme-dark .kpi-item span,
body.theme-dark .config-block h4 {
    color: #98acc4;
}

body.theme-dark .kpi-item strong {
    color: #e6edf7;
}

body.theme-dark .toggle-pill {
    border-color: #334457;
    background: #202b39;
}

body.theme-dark .toggle-pill:hover {
    border-color: #49607b;
    background: #253243;
}

body.theme-dark .config-actions {
    border-top-color: #334457;
}

body.theme-dark .panel-head {
    background: linear-gradient(180deg, #1c2634 0%, #18212d 100%);
}

body.theme-dark .file-tab {
    border-color: #3a4b61;
    background: #1f2a39;
    color: #a9bdd5;
}

body.theme-dark .file-tab.result {
    border-color: #355489;
    background: #1b3761;
    color: #b8d6ff;
}

body.theme-dark .result-tabs {
    background: #202a36;
    border-bottom-color: #334457;
}

body.theme-dark .result-tab {
    border-color: #3a4b61;
    background: #1f2a39;
    color: #a9bdd5;
}

body.theme-dark .result-tab:hover,
body.theme-dark .result-tab.active {
    border-color: #4b74a8;
    background: #27456c;
    color: #d4e7ff;
}

.diff-layer {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.48);
    backdrop-filter: blur(2px);
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.diff-layer.is-visible {
    display: flex;
}

.diff-card {
    width: min(1300px, 100%);
    max-height: min(86vh, 900px);
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.diff-head {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.diff-head h3 {
    margin: 0;
    font-size: 14px;
    color: var(--text);
}

.diff-head p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.diff-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 0;
    flex: 1;
}

.diff-pane {
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}

.diff-pane:last-child {
    border-right: 0;
}

.diff-pane-title {
    height: 36px;
    padding: 0 10px;
    border-bottom: 1px solid var(--border);
    background: var(--panel-soft);
    display: flex;
    align-items: center;
    font: 600 12px/1.2 var(--font-code);
    color: var(--muted);
}

.diff-pane-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    background: var(--input);
    font: 12px/1.6 var(--font-code);
}

.diff-line {
    display: grid;
    grid-template-columns: 56px 1fr;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.diff-line-num {
    text-align: right;
    padding: 0 8px;
    color: var(--line-num);
    border-right: 1px solid var(--border);
    user-select: none;
}

.diff-line-code {
    padding: 0 10px;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
}

.diff-line.changed {
    background: #fff7ed;
}

body.theme-dark .diff-line.changed {
    background: #332014;
}

.meta-grid {
    display: grid;
    gap: 8px;
}

.meta-grid div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 5px;
    font-size: 12px;
}

.meta-grid span {
    color: var(--muted);
}

.meta-grid strong {
    color: var(--text);
    text-align: right;
    word-break: break-all;
}

.workflow-track {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.stage-item {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    padding: 6px 8px;
    text-align: center;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
}

.stage-item.stage-active {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.stage-item.stage-done {
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}

.stage-item.stage-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.terminal-box {
    margin-top: 10px;
    border: 1px solid #0f172a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.terminal-head {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 10px;
    background: #0b1220;
    color: #94a3b8;
    border-bottom: 1px solid #1e293b;
    font: 12px/1.2 var(--font-code);
}

.terminal-head strong {
    margin-left: 4px;
    color: #cbd5e1;
    font-weight: 600;
}

.terminal-head .dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
}

.terminal-head .dot.red {
    background: #f87171;
}

.terminal-head .dot.yellow {
    background: #fbbf24;
}

.terminal-head .dot.green {
    background: #4ade80;
}

.log-box {
    min-height: 0;
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    padding: 10px 12px;
    background: #020617;
    font: 12px/1.6 var(--font-code);
    color: #cbd5e1;
    -webkit-overflow-scrolling: touch;
}

.log-item {
    margin-bottom: 4px;
    white-space: pre-wrap;
    word-break: break-word;
}

.log-time {
    color: #64748b;
}

.log-prefix {
    color: #38bdf8;
}

.log-item.level-success {
    color: #86efac;
}

.log-item.level-warn {
    color: #facc15;
}

.log-item.level-error {
    color: #fca5a5;
}

.log-item.level-cmd {
    color: #c4b5fd;
}

.log-item:last-child {
    margin-bottom: 0;
}

.footer-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.status-bar {
    font-size: 12px;
    color: var(--muted);
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-soft);
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    width: 100%;
    white-space: normal;
    word-break: break-word;
    line-height: 1.45;
}

.status-bar.status-success {
    color: var(--success);
}

.status-bar.status-error {
    color: var(--danger);
}

.status-bar.status-warn {
    color: var(--warn);
}

.token-keyword {
    color: #1d4ed8;
}

.token-string {
    color: #047857;
}

.token-comment {
    color: #64748b;
    font-style: italic;
}

.token-variable {
    color: #b45309;
}

.token-number {
    color: #dc2626;
}

.token-function {
    color: #0f766e;
}

body.theme-dark .token-keyword {
    color: #64a8ff;
}

body.theme-dark .token-string {
    color: #8fdc7d;
}

body.theme-dark .token-comment {
    color: #71839d;
}

body.theme-dark .token-variable {
    color: #e7bf5a;
}

body.theme-dark .token-number {
    color: #f58c6c;
}

body.theme-dark .token-function {
    color: #77c6e8;
}

@media (max-width: 1180px) {
    .workspace-grid,
    .options-grid {
        grid-template-columns: 1fr;
    }

    .options-grid {
        grid-auto-rows: auto;
    }

    .editor-panel,
    .option-card {
        height: auto;
        min-height: 0;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .config-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .editor-wrap {
        height: min(420px, 56vh);
        flex: initial;
    }
}

@media (min-width: 681px) and (max-width: 1180px) {
    .options-grid {
        grid-auto-rows: auto;
    }

    .option-card {
        height: auto;
        min-height: 0;
    }

    .option-card-config {
        overflow: visible;
        padding-bottom: 6px;
    }

    .option-card-console {
        overflow: hidden;
        height: clamp(420px, 56vh, 620px);
        min-height: clamp(420px, 56vh, 620px);
    }

    .option-card-console .terminal-box {
        flex: 1;
        min-height: 0;
    }
}

@media (max-width: 680px) {
    .app-shell {
        padding: 8px;
    }

    .topbar {
        padding: 10px;
    }

    .brand h1 {
        font-size: 16px;
    }

    .top-actions {
        width: 100%;
    }

    .action-btn {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }

    .editor-wrap {
        grid-template-columns: 46px 1fr;
        height: 44vh;
    }

    .panel-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "title title"
            "meta tools";
        gap: 6px 8px;
        align-items: center;
        padding: 9px 10px;
    }

    .panel-head > div:first-child {
        grid-area: title;
        min-width: 0;
    }

    .panel-head > div:first-child span {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .editor-head-meta {
        grid-area: meta;
        margin-left: 0;
        min-width: 0;
    }

    .panel-tools {
        grid-area: tools;
        width: auto;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 6px;
    }

    .file-tab {
        max-width: 46vw;
        font-size: 10px;
        padding: 4px 8px;
    }

    .result-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
        overscroll-behavior-x: contain;
    }

    .result-tabs:not(.diff-tabs) .result-tab {
        flex: 0 0 auto;
        width: max-content;
        min-width: max-content;
        max-width: none;
        white-space: nowrap;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    #captchaRow .captcha-group {
        grid-template-columns: minmax(0, 1fr) clamp(88px, 30vw, 108px);
        align-items: center;
        gap: 8px;
    }

    .workflow-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .options-grid {
        grid-auto-rows: auto;
    }

    .option-card {
        height: auto;
        min-height: 0;
    }

    .option-card-config {
        overflow: visible;
        padding-bottom: 6px;
    }

    .option-card-config .config-subtitle {
        margin-top: 2px;
        line-height: 1.4;
    }

    .option-card-config .config-kpis {
        margin-top: 8px;
        gap: 6px;
    }

    .option-card-config .config-head,
    .option-card-config .config-kpis,
    .option-card-config .config-actions,
    .option-card-config .config-status-row {
        flex: 0 0 auto;
    }

    .option-card-config .config-grid {
        flex: 0 0 auto;
        min-height: auto;
        margin-top: 8px;
        gap: 8px;
        overflow: visible;
        padding-right: 0;
    }

    .option-card-config .config-actions {
        margin-top: 8px;
        padding-top: 8px;
    }

    .option-card-config .config-status-row {
        margin-top: 6px;
        padding-bottom: 0;
    }

    .option-card-console {
        overflow: hidden;
    }

    .option-card-console .terminal-box {
        flex: 0 0 auto;
        height: clamp(240px, 38vh, 340px);
        max-height: 52vh;
        min-height: 220px;
    }

    .config-kpis {
        grid-template-columns: 1fr;
    }

    #captchaRow .decode-captcha {
        width: 100%;
        min-width: 88px;
    }

    .footer-actions {
        width: 100%;
    }

    .main-btn {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }

    .status-bar {
        width: 100%;
    }

    .diff-grid {
        grid-template-columns: 1fr;
    }

    .diff-pane {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .diff-pane:last-child {
        border-bottom: 0;
    }
}
