:root {
    color-scheme: light;
    --workbench-border: #d9dee7;
    --workbench-muted: #687386;
    --workbench-primary: #009688;
    --workbench-primary-hover: #008578;
    --workbench-panel: #ffffff;
    --workbench-subtle: #f5f7fa;
    --workbench-result-height: 238px;
    --workbench-toolbar-height: 50px;
    --workbench-viewport-height: 100vh;
}

@supports (height: 100dvh) {
    :root {
        --workbench-viewport-height: 100dvh;
    }
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body.code-workbench-page {
    min-width: 0;
    color: #263142;
    background: #eef1f5;
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
select,
textarea {
    font: inherit;
}

button {
    touch-action: manipulation;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.code-workbench {
    --workbench-result-height-current: var(--workbench-result-height);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) 26px;
    width: 100%;
    height: var(--workbench-viewport-height);
    min-width: 0;
    overflow: hidden;
    background: var(--workbench-panel);
}

.workbench-header {
    position: relative;
    z-index: 3;
    min-width: 0;
    border-bottom: 1px solid var(--workbench-border);
    background: #fff;
}

.workbench-breadcrumb {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 34px;
    padding: 7px 14px 5px;
    color: var(--workbench-muted);
    font-size: 13px;
}

.workbench-breadcrumb i {
    color: #b1b8c3;
    font-style: normal;
}

.workbench-breadcrumb strong {
    color: #354052;
    font-weight: 500;
}

.workbench-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
    min-height: var(--workbench-toolbar-height);
    padding: 6px 12px;
    border-top: 1px solid #f0f2f5;
}

.workbench-select {
    width: clamp(126px, 18vw, 210px);
    height: 36px;
    min-width: 0;
    padding: 0 32px 0 10px;
    color: #263142;
    border: 1px solid #cfd5de;
    border-radius: 4px;
    outline: 0;
    background: #fff;
}

.workbench-select:focus {
    border-color: var(--workbench-primary);
    box-shadow: 0 0 0 2px rgba(0, 150, 136, .12);
}

.source-file-name {
    max-width: min(32vw, 320px);
    min-width: 0;
    overflow: hidden;
    color: #5f6b7d;
    font-family: Consolas, "SFMono-Regular", monospace;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toolbar-spacer,
.result-tabs-spacer,
.status-spacer {
    flex: 1 1 auto;
    min-width: 0;
}

.workbench-button {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 4px;
    outline: 0;
    cursor: pointer;
    white-space: nowrap;
}

.workbench-button:focus-visible,
.result-tab:focus-visible,
.result-panel-toggle:focus-visible {
    box-shadow: 0 0 0 2px rgba(0, 150, 136, .22);
}

.workbench-button-secondary {
    color: #344054;
    border-color: #cfd5de;
    background: #fff;
}

.workbench-button-secondary:hover:not(:disabled) {
    background: #f5f7fa;
}

.workbench-button-primary {
    color: #fff;
    background: var(--workbench-primary);
}

.workbench-button-primary:hover:not(:disabled) {
    background: var(--workbench-primary-hover);
}

.workbench-button:disabled,
.workbench-select:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.workbench-button kbd {
    padding: 1px 4px;
    color: rgba(255, 255, 255, .88);
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 3px;
    background: rgba(0, 0, 0, .08);
    font: 11px/1.4 Consolas, monospace;
}

.workbench-notice {
    max-height: 74px;
    padding: 7px 14px;
    overflow: auto;
    color: #5d6676;
    border-top: 1px solid #f0f2f5;
    background: #fafbfc;
    font-size: 13px;
    white-space: pre-wrap;
}

.workbench-notice:empty {
    display: none;
}

.workbench-main {
    display: grid;
    grid-template-rows: minmax(220px, 1fr) 6px minmax(42px, var(--workbench-result-height-current));
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #fff;
}

.editor-pane {
    position: relative;
    grid-row: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #fff;
}

.editor-host,
.editor-fallback {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.editor-host {
    display: none;
}

.editor-fallback {
    display: block;
    padding: 12px 14px;
    resize: none;
    color: #1f2937;
    border: 0;
    outline: 0;
    background: #fff;
    font: 14px/1.55 Consolas, "SFMono-Regular", monospace;
    tab-size: 4;
}

.editor-host .cm-editor {
    width: 100%;
    height: 100%;
}

.editor-host .cm-scroller {
    overflow: auto;
    overscroll-behavior: contain;
}

.panel-splitter {
    position: relative;
    z-index: 2;
    grid-row: 2;
    cursor: row-resize;
    border-top: 1px solid #dce1e8;
    border-bottom: 1px solid #dce1e8;
    background: #f1f3f6;
    touch-action: none;
}

.panel-splitter::after {
    position: absolute;
    top: 1px;
    left: 50%;
    width: 42px;
    height: 2px;
    border-radius: 2px;
    background: #aab2bf;
    content: "";
    transform: translateX(-50%);
}

.panel-splitter:hover,
.panel-splitter:focus {
    background: #e5f4f2;
    outline: 0;
}

.result-pane {
    display: grid;
    grid-row: 3;
    grid-template-rows: 38px minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #fff;
}

.result-tabs {
    display: flex;
    align-items: stretch;
    min-width: 0;
    min-height: 38px;
    overflow-x: auto;
    border-bottom: 1px solid var(--workbench-border);
    background: var(--workbench-subtle);
    scrollbar-width: thin;
}

.result-tab,
.result-panel-toggle {
    flex: 0 0 auto;
    color: #556174;
    border: 0;
    outline: 0;
    background: transparent;
    cursor: pointer;
}

.result-tab {
    position: relative;
    min-width: 72px;
    padding: 0 12px;
}

.result-tab::after {
    position: absolute;
    right: 10px;
    bottom: 0;
    left: 10px;
    height: 2px;
    background: transparent;
    content: "";
}

.result-tab.is-active {
    color: #1f2937;
    font-weight: 600;
}

.result-tab.is-active::after {
    background: var(--workbench-primary);
}

.result-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-left: 3px;
    padding: 0 5px;
    color: #fff;
    border-radius: 9px;
    background: #8b95a5;
    font-size: 11px;
    font-weight: 500;
}

.result-count.has-errors {
    background: #d92d20;
}

.result-panel-toggle {
    width: 42px;
    min-height: 38px;
    font-size: 19px;
}

.result-content {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.result-view {
    display: none;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: auto;
}

.result-view.is-active {
    display: block;
}

.console-output {
    min-height: 100%;
    margin: 0;
    padding: 10px 14px;
    overflow: auto;
    color: #e5e7eb;
    background: #151a21;
    font: 13px/1.55 Consolas, "SFMono-Regular", monospace;
    tab-size: 4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.console-error {
    color: #ffc7c2;
}

.problem-list {
    min-width: 0;
}

.problem-item {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 7px;
    align-items: start;
    width: 100%;
    min-height: 36px;
    padding: 8px 12px;
    color: #303a4b;
    border: 0;
    border-bottom: 1px solid #edf0f4;
    outline: 0;
    background: #fff;
    text-align: left;
}

button.problem-item {
    cursor: pointer;
}

button.problem-item:hover,
button.problem-item:focus-visible {
    background: #f5faf9;
}

.problem-icon {
    color: #d92d20;
    font-weight: 700;
    text-align: center;
}

.problem-item.is-warning .problem-icon {
    color: #dc8b00;
}

.problem-message {
    min-width: 0;
    overflow-wrap: anywhere;
}

.problem-code {
    color: #748094;
    font-family: Consolas, monospace;
}

.problem-location {
    color: #748094;
    font: 12px/1.5 Consolas, monospace;
    white-space: nowrap;
}

.result-empty {
    padding: 14px;
    color: #7b8595;
}

.result-preview,
.result-preview.is-active {
    overflow: hidden;
}

.result-preview iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.workbench-statusbar {
    display: flex;
    gap: 16px;
    align-items: center;
    min-width: 0;
    padding: 0 10px;
    overflow-x: auto;
    color: rgba(255, 255, 255, .94);
    background: #087f73;
    font-size: 12px;
    white-space: nowrap;
    scrollbar-width: none;
}

.workbench-statusbar::-webkit-scrollbar {
    display: none;
}

.workbench-statusbar .is-warning {
    color: #ffe08a;
    font-weight: 600;
}

.code-workbench.result-collapsed {
    --workbench-result-height-current: 38px !important;
}

.code-workbench.result-collapsed .panel-splitter {
    display: none;
}

.code-workbench.result-collapsed .result-pane {
    grid-template-rows: 38px 0;
}

.code-workbench.result-collapsed .result-panel-toggle {
    transform: rotate(180deg);
}

.code-workbench.is-pseudo-fullscreen {
    position: fixed;
    z-index: 2147483000;
    inset: 0;
}

body.workbench-fullscreen {
    background: #fff;
}

@media (max-width: 680px) {
    :root {
        --workbench-result-height: min(30vh, 210px);
    }

    html,
    body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body.code-workbench-page {
        min-height: var(--workbench-viewport-height);
    }

    .code-workbench {
        grid-template-rows: auto auto minmax(28px, auto);
        height: auto;
        min-height: var(--workbench-viewport-height);
        overflow: visible;
    }

    .workbench-breadcrumb {
        min-height: 29px;
        padding: 5px 9px 3px;
        font-size: 12px;
    }

    .workbench-toolbar {
        gap: 6px;
        min-height: 44px;
        padding: 5px 7px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .workbench-toolbar::-webkit-scrollbar {
        display: none;
    }

    .workbench-select {
        flex: 0 0 128px;
        width: 128px;
        height: 38px;
    }

    .source-file-name {
        display: none;
    }

    .toolbar-spacer {
        display: none;
    }

    .workbench-button {
        flex: 0 0 auto;
        min-height: 38px;
        padding: 0 10px;
    }

    .workbench-button kbd {
        display: none;
    }

    .workbench-notice {
        max-height: 55px;
        padding: 5px 9px;
        font-size: 12px;
    }

    .workbench-main {
        grid-template-rows: minmax(260px, 55vh) 0 minmax(38px, var(--workbench-result-height-current));
        min-height: 0;
        overflow: visible;
    }

    .panel-splitter {
        display: none;
    }

    .result-tab {
        min-width: 66px;
        padding: 0 9px;
    }

    .problem-item {
        grid-template-columns: 18px minmax(0, 1fr);
    }

    .problem-location {
        grid-column: 2;
    }

    .workbench-statusbar {
        gap: 12px;
        min-height: calc(28px + env(safe-area-inset-bottom, 0px));
        padding: 0 8px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

@media (max-width: 430px) {
    .workbench-button-secondary span:nth-child(2) {
        display: none;
    }

    .workbench-button-secondary {
        width: 38px;
        padding: 0;
    }

    .workbench-button-primary {
        padding: 0 12px;
    }
}

@media (max-width: 680px) and (max-height: 500px) {
    :root {
        --workbench-result-height: min(28vh, 140px);
    }

    .workbench-breadcrumb {
        display: none;
    }

    .workbench-notice {
        max-height: 38px;
    }

    .workbench-main {
        grid-template-rows: minmax(180px, 52vh) 0 minmax(38px, var(--workbench-result-height-current));
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
