:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --ink: #0f172a;
    --muted: #607089;
    --line: #e2e8f0;
    --line-strong: rgba(16, 163, 127, 0.18);
    --accent: #10a37f;
    --accent-strong: #0f8b6d;
    --accent-soft: rgba(16, 163, 127, 0.08);
    --success: #0f8b6d;
    --warning: #b7791f;
    --danger: #cf4a3f;
    --dark: #111827;
    --radius-lg: 18px;
    --radius-md: 14px;
    --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.07);
    --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.05);
    --max-width: 1180px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

code {
    font-family: "SFMono-Regular", Consolas, monospace;
}

.container {
    width: min(calc(100% - 1.4rem), var(--max-width));
    margin: 0 auto;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(17, 24, 39, 0.94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4.4rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.82rem;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 0.88rem;
    background: linear-gradient(135deg, var(--accent), #1ac395);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(16, 163, 127, 0.24);
}

.brand-copy {
    display: flex;
    flex-direction: column;
}

.brand-copy strong {
    color: #fff;
    font-size: 0.98rem;
}

.brand-copy small {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.75rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.header-link,
.header-button,
.button,
.mini-link,
.session-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.65rem;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.header-link {
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.88);
}

.header-button,
.button-primary {
    border: none;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #1ab88f);
    box-shadow: 0 12px 24px rgba(16, 163, 127, 0.18);
}

.button-dark {
    border: none;
    color: #fff;
    background: linear-gradient(135deg, #1f2937, #334155);
}

.button:hover,
.header-link:hover,
.header-button:hover,
.mini-link:hover,
.session-chip:hover {
    transform: translateY(-1px);
}

.button:disabled {
    opacity: 0.72;
    cursor: wait;
    transform: none;
}

.dashboard-shell {
    flex: 1;
    padding: 0.95rem 0;
}

.dashboard-grid {
    display: grid;
    gap: 0.95rem;
    grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
    align-items: start;
}

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
}

.intro-card {
    display: grid;
    gap: 0.95rem;
    padding: 0.95rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    margin-bottom: 0.95rem;
}

.intro-head {
    display: grid;
    align-content: center;
    gap: 0.55rem;
    min-width: 0;
}

.eyebrow,
.panel-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    margin: 0 0 0.7rem;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.eyebrow::before,
.panel-kicker::before {
    content: "";
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    background: var(--accent);
}

.intro-head h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1;
    letter-spacing: -0.05em;
}

.intro-text {
    margin: 0;
    color: var(--muted);
    line-height: 1.68;
}

.verify-spotlight {
    align-self: center;
    padding: 1rem;
    border: 1px solid rgba(16, 163, 127, 0.18);
    border-radius: 18px;
    background: linear-gradient(180deg, #f6fffb 0%, #ffffff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 16px 32px rgba(16, 163, 127, 0.08);
}

.verify-spotlight-head {
    display: grid;
    gap: 0.3rem;
    margin-bottom: 0.85rem;
}

.verify-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.28rem 0.68rem;
    border-radius: 999px;
    background: rgba(16, 163, 127, 0.12);
    color: var(--accent-strong);
    font-size: 0.76rem;
    font-weight: 800;
}

.verify-spotlight-head h3 {
    margin: 0;
    font-size: 1.34rem;
    letter-spacing: -0.03em;
}

.verify-spotlight-head p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.verify-form {
    display: grid;
    gap: 0.8rem;
}

.verify-field {
    margin: 0;
}

.verify-button {
    width: 100%;
    min-height: 3rem;
    font-size: 1rem;
}

.intro-toolbar {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.95rem;
    grid-column: 1 / -1;
}

.link-row,
.trust-row,
.session-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.mini-link,
.session-chip {
    border: 1px solid rgba(16, 163, 127, 0.16);
    background: #f7fffc;
    color: var(--accent-strong);
}

.trust-row span {
    padding: 0.5rem 0.82rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.84rem;
}

.panel-head {
    margin-bottom: 0.85rem;
}

.panel-head h2,
.step-head h3,
.status-box h3,
.query-box h3,
.status-headline {
    margin: 0;
}

.panel-head h2,
.status-headline {
    font-size: clamp(1.45rem, 3vw, 2rem);
    letter-spacing: -0.04em;
}

.step-card {
    padding: 0.92rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
}

.step-card + .step-card {
    margin-top: 0.78rem;
}

.step-card.is-current {
    border-color: var(--line-strong);
    background: linear-gradient(180deg, #ffffff, #fbfffd);
    box-shadow: var(--shadow-md);
}

.step-card.is-locked {
    opacity: 0.64;
}

.step-card:not(.is-current) .simple-form,
.step-card:not(.is-current) .inline-result,
.step-card:not(.is-current) .summary-box,
.step-card:not(.is-current) .session-shortcuts {
    display: none;
}

.step-card:not(.is-current) .step-head {
    margin-bottom: 0;
}

.step-card:not(.is-current) .step-head p {
    display: none;
}

.step-head {
    display: flex;
    align-items: flex-start;
    gap: 0.82rem;
    margin-bottom: 0.82rem;
}

.step-index {
    display: grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.82rem;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 900;
    flex: 0 0 auto;
}

.step-head p {
    margin: 0.18rem 0 0;
    color: var(--muted);
    line-height: 1.58;
}

.step-static-note {
    display: grid;
    gap: 0.24rem;
    padding: 0.85rem 0.9rem;
    border: 1px dashed rgba(16, 163, 127, 0.24);
    border-radius: 13px;
    background: var(--surface-soft);
}

.step-static-note strong {
    font-size: 0.92rem;
}

.step-static-note span {
    color: var(--muted);
    line-height: 1.55;
}

.simple-form {
    display: grid;
    gap: 0.82rem;
}

.field {
    display: grid;
    gap: 0.38rem;
}

.field span {
    font-size: 0.9rem;
    font-weight: 800;
}

.field input,
.field textarea {
    width: 100%;
    padding: 0.84rem 0.9rem;
    border: 1px solid #cbd5e1;
    border-radius: 13px;
    background: #fff;
    color: var(--ink);
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: rgba(16, 163, 127, 0.42);
    box-shadow: 0 0 0 4px rgba(16, 163, 127, 0.1);
}

.field textarea {
    resize: vertical;
    min-height: 8.8rem;
}

.inline-result {
    margin-top: 0.75rem;
    padding: 0.82rem 0.88rem;
    border-radius: 13px;
    border: 1px solid var(--line);
    font-size: 0.9rem;
    line-height: 1.62;
}

.inline-result a {
    color: var(--accent-strong);
    font-weight: 700;
}

.inline-result-muted {
    background: #f8fafc;
    color: var(--muted);
}

.inline-result-success {
    background: rgba(15, 139, 109, 0.08);
    border-color: rgba(15, 139, 109, 0.16);
    color: var(--success);
}

.inline-result-error {
    background: rgba(207, 74, 63, 0.08);
    border-color: rgba(207, 74, 63, 0.16);
    color: var(--danger);
}

.summary-box {
    display: grid;
    gap: 0.68rem;
    margin-bottom: 0.85rem;
}

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

.summary-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-item {
    padding: 0.8rem 0.84rem;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-soft);
}

.summary-item span {
    display: block;
    margin-bottom: 0.22rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.summary-item strong {
    font-size: 0.92rem;
    word-break: break-word;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 700;
}

.check-row input {
    width: 1rem;
    height: 1rem;
}

.status-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 5.8rem;
    padding: 0.46rem 0.76rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
}

.status-idle {
    background: #eef2f7;
    color: var(--muted);
}

.status-busy {
    background: rgba(183, 121, 31, 0.12);
    color: var(--warning);
}

.status-done,
.status-success {
    background: rgba(15, 139, 109, 0.12);
    color: var(--success);
}

.status-error {
    background: rgba(207, 74, 63, 0.12);
    color: var(--danger);
}

.status-box {
    margin-top: 0.82rem;
    padding: 0.88rem;
    border-radius: 13px;
    border: 1px solid var(--line);
    background: #f8fafc;
}

.status-box p,
.query-box p,
.progress-item span {
    margin: 0.3rem 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.progress-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0.85rem 0;
    padding: 0;
    list-style: none;
}

.progress-item {
    position: relative;
    padding: 0.8rem 0.84rem 0.8rem 2.35rem;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
}

.progress-item::before {
    content: "";
    position: absolute;
    left: 0.86rem;
    top: 0.95rem;
    width: 0.78rem;
    height: 0.78rem;
    border-radius: 999px;
    background: #cbd5e1;
}

.progress-item strong {
    display: block;
    font-size: 0.9rem;
}

.progress-item.is-current::before {
    background: var(--accent);
}

.progress-item.is-done::before {
    background: var(--success);
}

.progress-item.is-failed::before {
    background: var(--danger);
}

.result-card {
    padding: 0.9rem;
    border-radius: 14px;
    background: linear-gradient(180deg, #111827, #1f2937);
    color: #eef4ff;
    min-height: 14rem;
    max-height: 26rem;
    overflow: auto;
}

.result-stage {
    display: flex;
    align-items: center;
    gap: 0.82rem;
    margin-bottom: 0.9rem;
}

.result-stage strong {
    display: block;
    font-size: 0.98rem;
}

.result-stage small {
    display: block;
    margin-top: 0.2rem;
    color: rgba(238, 244, 255, 0.74);
    line-height: 1.55;
}

.loading-ring {
    width: 1.08rem;
    height: 1.08rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 999px;
    animation: spin 0.75s linear infinite;
    flex: 0 0 auto;
}

.detail-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-item {
    padding: 0.76rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.detail-item.span-full {
    grid-column: 1 / -1;
}

.detail-item span {
    display: block;
    margin-bottom: 0.22rem;
    color: rgba(238, 244, 255, 0.68);
    font-size: 0.78rem;
}

.detail-item strong {
    display: block;
    word-break: break-word;
    font-size: 0.9rem;
    color: #ffffff;
}

.query-box {
    margin-top: 0.82rem;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.query-box h3 {
    font-size: 0.98rem;
}

.compact-form {
    margin-top: 0.72rem;
}

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

@media (min-width: 981px) {
    body {
        overflow: hidden;
    }

    .intro-card {
        grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
        align-items: stretch;
    }

    .dashboard-shell {
        height: calc(100vh - 4.4rem);
        overflow: hidden;
    }

    .dashboard-grid,
    .flow-panel,
    .status-panel {
        height: 100%;
    }

    .flow-panel,
    .status-panel {
        overflow: auto;
    }
}

@media (max-width: 980px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .summary-grid,
    .summary-compact,
    .progress-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(calc(100% - 1rem), var(--max-width));
    }

    .header-row,
    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        width: 100%;
    }

    .panel {
        padding: 0.9rem;
    }

    .intro-card {
        padding: 0.88rem;
    }

    .verify-spotlight {
        padding: 0.88rem;
    }

    .link-row,
    .trust-row,
    .session-shortcuts {
        flex-direction: column;
    }
}
