:root {
    --bg: #070b16;
    --panel: rgba(17, 24, 41, .78);
    --panel-solid: #111829;
    --line: rgba(255, 255, 255, .085);
    --line-strong: rgba(255, 255, 255, .14);
    --text: #f2f5fc;
    --muted: #8d97ad;
    --muted-2: #5d6780;
    --brand: #6d8bff;
    --brand-2: #4f6df5;
    --teal: #35d0ba;
    --danger: #ff5d6c;
    --ok: #2ee6a8;
    --radius: 24px;
    --shadow: 0 30px 80px rgba(0, 0, 0, .5);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text);
    font-family: var(--font);
    background:
        radial-gradient(900px 620px at 8% -12%, rgba(91, 124, 250, .30), transparent 62%),
        radial-gradient(760px 540px at 108% 8%, rgba(53, 208, 186, .14), transparent 58%),
        var(--bg);
    overflow-x: hidden;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 20%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 20%, transparent 78%);
}

a {
    color: inherit;
}

.ambient {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.orb {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
}

.orb-a {
    width: 300px;
    height: 300px;
    top: -120px;
    left: -90px;
    background: rgba(79, 109, 245, .55);
    animation: drift 16s ease-in-out infinite;
}

.orb-b {
    width: 240px;
    height: 240px;
    right: -100px;
    top: 220px;
    background: rgba(53, 208, 186, .26);
    animation: drift 20s ease-in-out infinite reverse;
}

.orb-c {
    width: 300px;
    height: 300px;
    left: 30%;
    bottom: -190px;
    background: rgba(115, 82, 255, .2);
}

@keyframes drift {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(18px, -26px, 0); }
}

.app {
    width: 100%;
    max-width: 460px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding:
        calc(20px + env(safe-area-inset-top))
        20px
        calc(22px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
}

/* ------------------------------------------------------------------ */
/* 品牌                                                                */
/* ------------------------------------------------------------------ */
.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 2px 2px 0;
}

.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(145deg, rgba(109, 139, 255, .98), rgba(79, 109, 245, .82));
    box-shadow: 0 10px 26px rgba(79, 109, 245, .34), inset 0 1px 0 rgba(255, 255, 255, .28);
}

.brand-mark svg {
    width: 25px;
    height: 25px;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    gap: 4px;
}

.brand-copy strong {
    font-size: 16px;
    letter-spacing: .02em;
    font-weight: 700;
}

.brand-copy span {
    font-size: 9px;
    letter-spacing: .18em;
    color: var(--muted-2);
    font-weight: 600;
}

.brand-tools {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .025);
}

.lang-btn {
    min-width: 30px;
    padding: 5px 7px;
    border: 0;
    border-radius: 999px;
    color: #6f7b94;
    background: transparent;
    font: 700 10.5px/1 var(--font);
    cursor: pointer;
    transition: color .2s, background .2s, box-shadow .2s;
}

.lang-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #728cff, #4f6df5);
    box-shadow: 0 4px 12px rgba(79, 109, 245, .3);
}

.lang-btn:focus-visible {
    outline: 2px solid #a9baff;
    outline-offset: 2px;
}

.brand-secure {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #7f8aa3;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 9px;
    background: rgba(255, 255, 255, .025);
    white-space: nowrap;
}

.brand-secure i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(46, 230, 168, .12);
}

/* ------------------------------------------------------------------ */
/* 卡片                                                                */
/* ------------------------------------------------------------------ */
.card {
    position: relative;
    margin-top: clamp(20px, 4.5vh, 42px);
    padding: 24px 22px 22px;
    transition: opacity .22s ease;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(24, 32, 53, .86), rgba(12, 18, 32, .9));
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .055);
    backdrop-filter: blur(22px) saturate(130%);
    -webkit-backdrop-filter: blur(22px) saturate(130%);
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(122, 150, 255, .65), transparent);
    opacity: .8;
}

.card::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -100px;
    top: -110px;
    border-radius: 50%;
    background: rgba(109, 139, 255, .12);
    filter: blur(10px);
    pointer-events: none;
}

.card.shake {
    animation: cardShake .42s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes cardShake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-3px); }
    40%, 60% { transform: translateX(3px); }
}

/* ------------------------------------------------------------------ */
/* 步骤                                                                */
/* ------------------------------------------------------------------ */
.steps {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 26px;
}

.step {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted-2);
    font-size: 11px;
    transition: color .25s;
    white-space: nowrap;
}

.step span {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(9, 14, 26, .8);
    color: var(--muted-2);
    transition: all .28s;
}

.step em {
    font-style: normal;
    font-weight: 500;
}

.step.active {
    color: #dfe6ff;
}

.step.active span {
    color: #071021;
    border-color: transparent;
    background: linear-gradient(145deg, #8fa4ff, #5d7bff);
    box-shadow: 0 0 0 4px rgba(109, 139, 255, .12), 0 5px 16px rgba(79, 109, 245, .35);
}

.step.done {
    color: #8f9bb4;
}

.step.done span {
    color: var(--ok);
    border-color: rgba(46, 230, 168, .3);
    background: rgba(46, 230, 168, .09);
}

.step.done span::after {
    content: "";
}

.step-line {
    flex: 1;
    height: 1px;
    min-width: 8px;
    background: linear-gradient(90deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .04));
}

.step.done + .step-line {
    background: linear-gradient(90deg, rgba(46, 230, 168, .38), rgba(255, 255, 255, .06));
}

/* ------------------------------------------------------------------ */
/* 屏幕切换                                                            */
/* ------------------------------------------------------------------ */
body.is-booting .card {
    opacity: 0;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: screenIn .34s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes screenIn {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

.head h1 {
    margin: 0 0 7px;
    font-size: 25px;
    line-height: 1.22;
    letter-spacing: -.02em;
    font-weight: 700;
}

.head p {
    margin: 0 0 23px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

/* ------------------------------------------------------------------ */
/* 表单                                                                */
/* ------------------------------------------------------------------ */
.field {
    display: block;
    margin-bottom: 16px;
}

.field .label {
    display: block;
    margin-bottom: 8px;
    color: #aab4c9;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: .01em;
}

.control {
    position: relative;
    display: flex;
    align-items: center;
}

.control .ico {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #65718a;
    pointer-events: none;
    transition: color .2s;
}

.control input {
    width: 100%;
    height: 52px;
    padding: 0 46px 0 43px;
    color: var(--text);
    font: 500 16px/1 var(--font);
    letter-spacing: .01em;
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: none;
    background: rgba(7, 12, 23, .72);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .2);
    transition: border-color .2s, box-shadow .2s, background .2s;
    appearance: none;
    -webkit-appearance: none;
}

.control input::placeholder {
    color: #566179;
    font-weight: 400;
}

.control input:focus {
    border-color: rgba(109, 139, 255, .7);
    background: rgba(7, 12, 23, .92);
    box-shadow: 0 0 0 3px rgba(109, 139, 255, .13), inset 0 1px 2px rgba(0, 0, 0, .2);
}

.control input:focus ~ .ico,
.control:focus-within .ico {
    color: #8fa4ff;
}

.field.is-invalid .control input {
    border-color: rgba(255, 93, 108, .68);
    box-shadow: 0 0 0 3px rgba(255, 93, 108, .1);
}

.field.is-invalid .ico {
    color: #ff7d89;
}

.err {
    display: none;
    margin-top: 7px;
    padding-left: 2px;
    color: #ff8b96;
    font-size: 11.5px;
    line-height: 1.4;
}

.field.is-invalid .err {
    display: block;
    animation: errIn .22s ease both;
}

@keyframes errIn {
    from { opacity: 0; transform: translateY(-3px); }
    to { opacity: 1; transform: translateY(0); }
}

.eye {
    position: absolute;
    right: 7px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    color: #69758f;
    background: transparent;
    cursor: pointer;
}

.eye svg {
    width: 19px;
    height: 19px;
}

.eye .eye-slash {
    opacity: 1;
    transition: opacity .18s;
}

.eye.is-on .eye-slash {
    opacity: 0;
}

.eye.is-on {
    color: #a7b5d8;
}

/* ------------------------------------------------------------------ */
/* 按钮                                                                */
/* ------------------------------------------------------------------ */
.btn {
    position: relative;
    width: 100%;
    height: 52px;
    margin-top: 6px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    font: 700 16px/1 var(--font);
    letter-spacing: .02em;
    cursor: pointer;
    background: linear-gradient(135deg, #7b95ff 0%, #536ff7 46%, #3cbfae 130%);
    box-shadow: 0 13px 30px rgba(79, 109, 245, .3), inset 0 1px 0 rgba(255, 255, 255, .28);
    transition: transform .16s, box-shadow .2s, filter .2s;
    overflow: hidden;
}

.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .22) 48%, transparent 72%);
    transform: translateX(-130%);
    transition: transform .7s ease;
}

.btn:hover::after {
    transform: translateX(130%);
}

.btn:active {
    transform: translateY(1px) scale(.994);
    box-shadow: 0 7px 20px rgba(79, 109, 245, .25), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.btn:focus-visible {
    outline: 2px solid #a9baff;
    outline-offset: 3px;
}

.btn:disabled {
    cursor: default;
    filter: saturate(.85);
    opacity: .78;
}

.btn .arrow {
    width: 18px;
    height: 18px;
    opacity: .9;
}

.btn .spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.btn.is-loading .spinner {
    display: block;
}

.btn.is-loading .arrow {
    display: none;
}

.btn.is-loading .btn-label {
    opacity: .82;
}

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

/* ------------------------------------------------------------------ */
/* 辅助组件                                                            */
/* ------------------------------------------------------------------ */
.terms {
    margin: 17px 2px 0;
    text-align: center;
    color: #59647b;
    font-size: 10.5px;
    line-height: 1.55;
}

.terms b {
    color: #7a879f;
    font-weight: 500;
}

.account-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -4px 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255, 255, 255, .026);
}

.account-chip span {
    color: var(--muted);
    font-size: 11.5px;
}

.account-chip b {
    color: #dfe6ff;
    font-size: 13px;
    font-weight: 600;
    max-width: 68%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note {
    display: flex;
    gap: 10px;
    margin: 0 0 20px;
    padding: 13px 14px;
    border: 1px solid rgba(109, 139, 255, .18);
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(79, 109, 245, .1), rgba(53, 208, 186, .05));
}

.note svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    margin-top: 1px;
    color: #8fa4ff;
}

.note p {
    margin: 0;
    color: #9ba7c0;
    font-size: 11.5px;
    line-height: 1.55;
}

/* ------------------------------------------------------------------ */
/* 成功态                                                              */
/* ------------------------------------------------------------------ */
.success {
    padding: 16px 4px 10px;
    text-align: center;
}

.success-ring {
    width: 82px;
    height: 82px;
    margin: 2px auto 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--ok);
    border: 1px solid rgba(46, 230, 168, .32);
    background:
        radial-gradient(circle at 50% 42%, rgba(46, 230, 168, .18), rgba(46, 230, 168, .03) 70%);
    box-shadow: 0 0 0 8px rgba(46, 230, 168, .035), 0 20px 50px rgba(0, 0, 0, .28);
    animation: pop .5s cubic-bezier(.2, 1.35, .4, 1) both;
}

.success-ring svg {
    width: 38px;
    height: 38px;
}

@keyframes pop {
    from { transform: scale(.72); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.success h1 {
    margin: 0 0 9px;
    font-size: 25px;
    letter-spacing: -.02em;
}

.success p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.success .account {
    color: #dfe6ff;
    font-weight: 600;
    word-break: break-all;
}

.progress-bar {
    width: 150px;
    height: 3px;
    margin: 26px auto 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    overflow: hidden;
}

.progress-bar i {
    display: block;
    width: 44%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6d8bff, #35d0ba);
    animation: slide 1.15s ease-in-out infinite;
}

@keyframes slide {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(330%); }
}

.done-badge {
    width: fit-content;
    margin: 28px auto 2px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 13px;
    border: 1px solid rgba(46, 230, 168, .2);
    border-radius: 999px;
    color: #8fe8c8;
    background: rgba(46, 230, 168, .06);
    font-size: 11.5px;
}

.done-badge svg {
    width: 15px;
    height: 15px;
}

/* ------------------------------------------------------------------ */
/* 页脚 / 提示                                                         */
/* ------------------------------------------------------------------ */
.app-foot {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #48536a;
    font-size: 10px;
    letter-spacing: .01em;
}

.lock-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(46, 230, 168, .7);
}

.toast {
    position: fixed;
    top: auto;
    bottom: calc(22px + env(safe-area-inset-bottom));
    left: 50%;
    z-index: 100;
    max-width: min(420px, calc(100vw - 32px));
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 17px;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    color: #f6f8ff;
    background: rgba(17, 24, 41, .96);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    font-size: 13px;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 14px) scale(.98);
    transition: opacity .22s, transform .26s;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.toast-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--muted);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .05);
}

.toast.error {
    border-color: rgba(255, 93, 108, .38);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 93, 108, .05) inset;
}

.toast.error .toast-dot {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(255, 93, 108, .1), 0 0 12px rgba(255, 93, 108, .55);
}

.toast.ok {
    border-color: rgba(46, 230, 168, .32);
}

.toast.ok .toast-dot {
    background: var(--ok);
    box-shadow: 0 0 0 4px rgba(46, 230, 168, .09), 0 0 12px rgba(46, 230, 168, .45);
}

.noscript {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 24px;
    color: #fff;
    background: #070b16;
    text-align: center;
    font-size: 14px;
}

/* ------------------------------------------------------------------ */
/* 适配                                                                */
/* ------------------------------------------------------------------ */
@media (max-height: 720px) {
    .app {
        padding-top: calc(12px + env(safe-area-inset-top));
    }

    .card {
        margin-top: 14px;
        padding-top: 20px;
    }

    .steps {
        margin-bottom: 20px;
    }

    .head h1 {
        font-size: 23px;
    }

    .head p {
        margin-bottom: 18px;
    }

    .field {
        margin-bottom: 14px;
    }

    .app-foot {
        padding-top: 12px;
    }
}

html[lang="hi"] .brand-copy span {
    letter-spacing: .04em;
}

html[lang="hi"] .head h1,
html[lang="hi"] .success h1 {
    letter-spacing: 0;
    line-height: 1.3;
}

html[lang="hi"] .head p {
    line-height: 1.6;
}

@media (max-width: 430px) {
    .brand-secure {
        display: none;
    }
}

@media (max-width: 360px) {
    .app {
        padding-left: 14px;
        padding-right: 14px;
    }

    .card {
        padding-left: 17px;
        padding-right: 17px;
    }

}

@media (max-width: 340px) {
    .step em {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
