:root {
    color-scheme: light;

    font-family:
        Inter,
        "PingFang SC",
        "Microsoft YaHei",
        system-ui,
        -apple-system,
        sans-serif;

    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-soft: #f2f4f8;
    --surface-muted: #eceff5;

    --text: #181a20;
    --text-strong: #111318;
    --muted: #697181;
    --muted-2: #9299a7;

    --border: #e2e5ec;
    --border-strong: #d4d9e3;

    --accent: #635bff;
    --accent-hover: #554de8;
    --accent-soft: #efedff;

    --danger: #cf4d45;

    background: var(--bg);
    color: var(--text);
}


* {
    box-sizing: border-box;
}


[hidden] {
    display: none !important;
}


html {
    background: var(--bg);
}


body {
    margin: 0;

    min-width: 320px;
    min-height: 100vh;

    background:
        radial-gradient(
            circle at 78% 0%,
            rgba(99, 91, 255, 0.07),
            transparent 28rem
        ),
        var(--bg);

    color: var(--text);
}


button,
input,
textarea,
select {
    font: inherit;
}


button,
a {
    -webkit-tap-highlight-color: transparent;
}


button {
    cursor: pointer;
}


button:disabled {
    cursor: default;
    opacity: 0.46;
}


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


.app-shell {
    min-height: 100vh;
}


.topbar {
    position: relative;
    z-index: 10;

    max-width: 1280px;
    height: 76px;

    margin: 0 auto;
    padding: 0 32px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border);
}


.brand-group,
.top-actions {
    display: flex;
    align-items: center;
}


.brand-group {
    gap: 12px;
}


.top-actions {
    gap: 10px;
}


.brand {
    color: #171923;

    font-size: 18px;
    font-weight: 850;
    letter-spacing: 0.22em;
}


.product-label {
    padding-left: 12px;

    border-left: 1px solid var(--border-strong);

    color: var(--muted-2);

    font-size: 12px;
    letter-spacing: 0.08em;
}


.home-link,
.ghost-button {
    border: 1px solid var(--border-strong);
    border-radius: 9px;

    background: #ffffff;

    color: #454b58;

    box-shadow:
        0 1px 2px
        rgba(26, 30, 40, 0.03);
}


.home-link {
    padding: 9px 14px;

    font-size: 13px;
}


.ghost-button {
    padding: 9px 14px;
}


.home-link:hover,
.ghost-button:hover {
    border-color: #c4cad5;

    background: #fafbfc;

    color: #17191f;
}


main {
    width: min(
        100% - 64px,
        1280px
    );

    margin: 0 auto;
}


#message {
    min-height: 26px;

    margin: 0;

    display: flex;
    align-items: center;

    color: var(--danger);

    font-size: 13px;
}


.auth-stage {
    min-height:
        calc(
            100vh - 102px
        );

    padding: 36px 0 76px;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(360px, 430px);

    align-items: center;
    gap: 86px;
}


.auth-intro {
    max-width: 650px;
}


.eyebrow,
.card-kicker,
.summary-label,
.panel-status {
    margin: 0;

    color: var(--accent);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
}


.auth-intro h1 {
    max-width: 620px;

    margin: 18px 0 22px;

    color: var(--text-strong);

    font-size:
        clamp(
            46px,
            5.1vw,
            72px
        );

    line-height: 1.03;
    letter-spacing: -0.05em;
}


.intro-copy {
    max-width: 570px;

    margin: 0;

    color: var(--muted);

    font-size: 17px;
    line-height: 1.78;
}


.preview-badges {
    margin-top: 30px;

    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}


.preview-badges span {
    padding: 8px 11px;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.72);

    color: #737b8a;

    font-size: 12px;
}


.auth-card {
    position: relative;

    padding: 34px;

    border: 1px solid var(--border);
    border-radius: 20px;

    background: rgba(255, 255, 255, 0.92);

    box-shadow:
        0 24px 65px
        rgba(48, 53, 70, 0.1);
}


.auth-card::before {
    position: absolute;

    content: "";

    inset: -1px 18% auto;

    height: 2px;

    border-radius: 999px;

    background:
        linear-gradient(
            90deg,
            transparent,
            var(--accent),
            transparent
        );
}


.card-heading {
    margin-bottom: 27px;
}


.card-heading h2 {
    margin: 10px 0 8px;

    color: var(--text-strong);

    font-size: 26px;
    letter-spacing: -0.025em;
}


.card-heading > p:last-child {
    margin: 0;

    color: var(--muted);

    font-size: 13px;
}


label {
    display: block;

    margin-bottom: 18px;

    color: #3e4551;

    font-size: 13px;
    font-weight: 650;
}


input,
textarea,
select {
    width: 100%;

    margin-top: 9px;
    padding: 12px 13px;

    border: 1px solid var(--border-strong);
    border-radius: 10px;

    outline: none;

    background: #ffffff;

    color: #1d2026;

    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}


input {
    min-height: 46px;
}


textarea {
    min-height: 154px;

    resize: vertical;

    line-height: 1.65;
}


select {
    min-height: 46px;
}


input::placeholder,
textarea::placeholder {
    color: #a0a6b2;
}


input:hover,
textarea:hover,
select:hover {
    border-color: #bec4d0;
}


input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);

    box-shadow:
        0 0 0 3px
        rgba(99, 91, 255, 0.11);

    background: #ffffff;
}


.primary-button,
.secondary-button {
    min-height: 46px;

    padding: 0 18px;

    border-radius: 10px;

    font-weight: 700;

    transition:
        transform 140ms ease,
        opacity 140ms ease,
        background 140ms ease,
        border-color 140ms ease,
        box-shadow 140ms ease;
}


.primary-button {
    border: 1px solid var(--accent);

    background: var(--accent);

    color: #ffffff;

    box-shadow:
        0 7px 18px
        rgba(99, 91, 255, 0.18);
}


.primary-button:not(:disabled):hover {
    border-color: var(--accent-hover);

    background: var(--accent-hover);

    transform: translateY(-1px);
}


.secondary-button {
    border: 1px solid var(--border-strong);

    background: #ffffff;

    color: #303642;
}


.secondary-button:not(:disabled):hover {
    border-color: #bcc2ce;

    background: #f9fafc;
}


.login-button {
    width: 100%;

    margin-top: 4px;
}


.auth-note {
    margin: 20px 0 0;
    padding-top: 18px;

    border-top: 1px solid var(--border);

    color: var(--muted-2);

    font-size: 12px;
    line-height: 1.65;
}


#workspace {
    padding: 48px 0 90px;
}


.workspace-title {
    margin-bottom: 30px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}


.workspace-title h1 {
    margin: 10px 0 9px;

    color: var(--text-strong);

    font-size:
        clamp(
            34px,
            4.5vw,
            52px
        );

    line-height: 1.06;
    letter-spacing: -0.042em;
}


.workspace-title > div > p:last-child {
    max-width: 620px;

    margin: 0;

    color: var(--muted);

    line-height: 1.7;
}


.summary {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 14px;

    margin-bottom: 16px;
}


.balance-card,
.mode-card {
    min-height: 116px;

    padding: 22px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    border: 1px solid var(--border);
    border-radius: 15px;

    background: var(--surface);

    box-shadow:
        0 7px 22px
        rgba(50, 55, 72, 0.04);
}


.balance-card strong,
.mode-card strong {
    color: var(--text-strong);

    font-size: 24px;
    letter-spacing: -0.02em;
}


.balance-card strong small,
.mode-card small {
    color: var(--muted-2);

    font-size: 12px;
    font-weight: 500;
}


.layout {
    display: grid;

    grid-template-columns:
        minmax(0, 0.92fr)
        minmax(0, 1.08fr);

    gap: 16px;
}


.panel {
    min-width: 0;

    padding: 26px;

    border: 1px solid var(--border);
    border-radius: 17px;

    background: var(--surface);

    box-shadow:
        0 8px 28px
        rgba(50, 55, 72, 0.045);
}


.panel-heading {
    margin-bottom: 26px;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}


.panel-heading h2 {
    margin: 7px 0 0;

    color: var(--text-strong);

    font-size: 21px;
    letter-spacing: -0.02em;
}


.panel-index {
    color: var(--accent);

    font-size: 11px;
    font-weight: 800;
}


.panel-status {
    padding: 7px 9px;

    border: 1px solid #dddafc;
    border-radius: 999px;

    background: var(--accent-soft);

    color: #5f56dd;

    letter-spacing: 0.08em;
}


.fields {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    column-gap: 14px;
}


.quote-box {
    margin-top: 8px;
    padding: 17px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface-soft);
}


.quote-label {
    display: block;

    margin-bottom: 7px;

    color: var(--muted-2);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
}


#quote-result {
    margin: 0;

    color: #656d7a;

    font-size: 13px;
    line-height: 1.6;
}


.form-actions {
    display: grid;

    grid-template-columns:
        0.8fr
        1.2fr;

    gap: 10px;

    margin-top: 16px;
}


.muted {
    margin: 22px 0 0;
    padding-top: 18px;

    border-top: 1px solid var(--border);

    color: var(--muted-2);

    font-size: 12px;
    line-height: 1.65;
}


#history {
    min-height: 210px;
}


#history > p {
    margin: 0;
    padding: 40px 0;

    color: var(--muted-2);

    text-align: center;
}


.task {
    margin-top: 12px;
    padding: 17px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: #fafbfc;
}


.task p {
    margin: 7px 0;

    overflow-wrap: anywhere;

    color: #4b5260;

    line-height: 1.55;
}


.task .status {
    color: var(--text-strong);

    font-weight: 750;
}


.task small {
    color: var(--muted-2);
}


.task button {
    margin: 10px 8px 0 0;
    padding: 8px 11px;

    border: 1px solid var(--border-strong);
    border-radius: 8px;

    background: #ffffff;

    color: #4b5260;
}


.task button:hover {
    border-color: #bfc5d0;

    background: #f7f8fb;
}


.pager {
    margin-top: 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    color: var(--muted-2);

    font-size: 12px;
}


video {
    width: 100%;

    margin-top: 20px;

    border: 1px solid #22252d;
    border-radius: 12px;

    background: #090a0d;
}


footer {
    width: min(
        100% - 64px,
        1280px
    );

    margin: 0 auto;
    padding: 28px 0 38px;

    display: flex;
    justify-content: space-between;
    gap: 20px;

    border-top: 1px solid var(--border);

    color: var(--muted-2);

    font-size: 11px;
}


button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}


@media (max-width: 920px) {

    .auth-stage {
        grid-template-columns: 1fr;

        gap: 40px;
        padding-top: 52px;
    }


    .auth-intro {
        max-width: 720px;
    }


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

}


@media (max-width: 640px) {

    .topbar {
        height: 68px;

        padding: 0 18px;
    }


    .product-label,
    .home-link {
        display: none;
    }


    main,
    footer {
        width: calc(100% - 36px);
    }


    #message {
        min-height: 20px;
    }


    .auth-stage {
        min-height:
            calc(
                100vh - 88px
            );

        padding: 38px 0 64px;

        gap: 34px;
    }


    .auth-intro h1 {
        font-size: 42px;
    }


    .intro-copy {
        font-size: 16px;
    }


    .auth-card {
        padding: 24px;

        border-radius: 16px;
    }


    #workspace {
        padding: 40px 0 68px;
    }


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


    .panel {
        padding: 20px;
    }


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


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


    .panel-heading {
        align-items: center;
    }


    footer {
        flex-direction: column;

        gap: 7px;
    }

}