* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: #18202f;
    background: #f5f7fb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    letter-spacing: 0;
}

button,
input,
textarea {
    font: inherit;
}

a {
    color: #1d4ed8;
}

.page {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
}

.topbar {
    height: 72px;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid #e3e8f1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
}

.topbar-inner {
    width: min(1120px, calc(100vw - 32px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 32px;
}

.topbar img {
    width: 34px;
    height: 34px;
}

.brand {
    display: grid;
    gap: 2px;
}

.brand strong {
    font-size: 18px;
    line-height: 1.2;
}

.brand span {
    color: #667085;
    font-size: 13px;
}

.shell {
    width: min(1120px, calc(100vw - 32px));
    margin: 32px auto;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.steps {
    display: grid;
    gap: 8px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #e3e8f1;
    border-radius: 8px;
}

.step {
    min-height: 46px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 9px;
    border-radius: 8px;
    color: #667085;
}

.step b {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: #667085;
    background: #eef2f7;
    font-size: 13px;
}

.step.active {
    color: #0f172a;
    background: #eef6ff;
}

.step.active b {
    color: #ffffff;
    background: #2563eb;
}

.step.done {
    color: #0f766e;
}

.step.done b {
    color: #ffffff;
    background: #0f766e;
}

.panel {
    min-height: 620px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: #ffffff;
    border: 1px solid #e3e8f1;
    border-radius: 8px;
    overflow: hidden;
}

.panel-head {
    padding: 24px 28px 18px;
    border-bottom: 1px solid #eef2f7;
}

.panel-head h1 {
    margin: 0 0 8px;
    font-size: 24px;
    line-height: 1.25;
}

.panel-head p {
    margin: 0;
    color: #667085;
    line-height: 1.6;
}

.panel-body {
    padding: 24px 28px;
}

.panel-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 28px;
    border-top: 1px solid #eef2f7;
    background: #fbfcfe;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn {
    min-height: 40px;
    min-width: 96px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #cfd8e6;
    border-radius: 8px;
    padding: 0 16px;
    color: #1f2937;
    background: #ffffff;
    cursor: pointer;
}

.btn.primary {
    border-color: #2563eb;
    color: #ffffff;
    background: #2563eb;
}

.btn.success {
    border-color: #0f766e;
    color: #ffffff;
    background: #0f766e;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: .48;
}

.license {
    width: 100%;
    min-height: 380px;
    max-height: 520px;
    overflow-y: auto;
    border: 1px solid #d8e0ec;
    border-radius: 8px;
    padding: 14px;
    color: #344054;
    background: #fbfcfe;
    line-height: 1.7;
}

.agree {
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #344054;
}

.agree input {
    width: 18px;
    height: 18px;
}

.check-list {
    display: grid;
    gap: 10px;
}

.check-row {
    min-height: 52px;
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) 170px 76px;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #e3e8f1;
    border-radius: 8px;
    background: #ffffff;
}

.tag {
    width: fit-content;
    max-width: 100%;
    padding: 4px 8px;
    color: #475467;
    background: #f2f4f7;
    border-radius: 6px;
    font-size: 12px;
}

.status {
    width: 72px;
    min-height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 6px;
    font-size: 13px;
    justify-self: end;
}

.status.ok {
    color: #0f766e;
    background: #e7f8f4;
}

.status.fail {
    color: #b42318;
    background: #fff0ed;
}

.muted {
    color: #667085;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-section {
    grid-column: 1 / -1;
    margin-top: 6px;
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
}

.field {
    display: grid;
    gap: 7px;
}

.field.full {
    grid-column: 1 / -1;
}

.field label {
    color: #344054;
    font-size: 14px;
}

.field input {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cfd8e6;
    border-radius: 8px;
    padding: 0 12px;
    color: #18202f;
    background: #ffffff;
}

.field input:focus {
    outline: 2px solid #bfdbfe;
    border-color: #2563eb;
}

.inline {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    color: #344054;
}

.inline input {
    width: 18px;
    height: 18px;
}

.notice {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    line-height: 1.6;
    color: #344054;
    background: #f8fafc;
}

.notice.ok {
    color: #0f766e;
    background: #e7f8f4;
    border-color: #b7eadf;
}

.notice.fail {
    color: #b42318;
    background: #fff0ed;
    border-color: #ffd2c7;
}

.terminal {
    height: 420px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-radius: 8px;
    background: #0d1117;
    padding: 18px;
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.65;
}

.terminal-logs {
    flex: 1;
}

.log-line {
    padding: 2px 0;
    color: #8b949e;
    word-break: break-all;
}

.log-line.log-info {
    color: #8b949e;
}

.log-line.log-success {
    color: #3fb950;
}

.log-line.log-error {
    color: #f85149;
}

.log-line.log-warning {
    color: #d2991d;
}

.log-time {
    color: #484f58;
    margin-right: 10px;
    white-space: nowrap;
}

.terminal-status {
    padding-top: 10px;
    color: #58a6ff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #30363d;
    border-top-color: #58a6ff;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.result {
    display: grid;
    gap: 18px;
}

.credential-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.credential {
    min-height: 86px;
    display: grid;
    gap: 8px;
    align-content: center;
    padding: 14px;
    border: 1px solid #e3e8f1;
    border-radius: 8px;
    background: #fbfcfe;
}

.credential span {
    color: #667085;
    font-size: 13px;
}

.credential strong {
    color: #0f172a;
    overflow-wrap: anywhere;
}

@media (max-width: 860px) {
    .topbar-inner {
        width: calc(100vw - 24px);
        padding: 0 18px;
    }

    .shell {
        width: calc(100vw - 24px);
        margin: 18px auto;
        grid-template-columns: 1fr;
    }

    .steps {
        grid-template-columns: repeat(5, minmax(92px, 1fr));
        overflow-x: auto;
    }

    .step {
        grid-template-columns: 24px minmax(58px, 1fr);
        min-width: 92px;
        font-size: 13px;
    }

    .panel {
        min-height: 0;
    }

    .form-grid,
    .credential-grid {
        grid-template-columns: 1fr;
    }

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

    .status {
        justify-self: start;
    }

    .panel-foot {
        flex-direction: column;
    }

    .actions {
        justify-content: stretch;
    }

    .btn {
        flex: 1 1 auto;
    }
}
