:root {
    --ink: #111827;
    --muted: #64748b;
    --line: #dbe3ef;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --green: #10c363;
    --danger: #dc2626;
    --success: #16a34a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-width: 320px;
    min-height: 100%;
}

body {
    color: var(--ink);
    background:
        radial-gradient(circle at 68% 8%, rgba(98, 183, 255, .24), transparent 32%),
        linear-gradient(180deg, #f8fbff 0%, #eef7ff 100%);
    font-family: "Microsoft Yahei", "PingFang SC", sans-serif;
}

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

.auth-shell {
    width: min(680px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-nav {
    display: none;
}

.auth-main {
    width: 100%;
    min-height: 0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .08);
    display: block;
    overflow: hidden;
}

.auth-card {
    padding: 42px 44px 34px;
    background: #fff;
}

.auth-kicker {
    display: none;
}

.auth-card h2 {
    margin: 0;
    color: #111827;
    font-size: 32px;
    line-height: 1.18;
    font-weight: 900;
}

.auth-card .hint {
    margin: 10px 0 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid #edf1f6;
    color: #60708a;
    font-size: 16px;
    line-height: 1.5;
}

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

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

.auth-field {
    margin-bottom: 15px;
}

.auth-field label {
    display: block;
    margin-bottom: 7px;
    color: #172033;
    font-size: 15px;
    font-weight: 700;
}

.auth-field input,
.auth-field select {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: #fff;
    font-size: 16px;
    outline: none;
}

.auth-field input::placeholder {
    color: #9aa8bd;
}

.auth-field input:focus,
.auth-field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}

.auth-message {
    min-height: 20px;
    margin: -1px 0 10px;
    color: var(--danger);
    font-size: 13px;
    font-weight: 700;
}

.auth-message.is-success {
    color: var(--success);
}

.primary-btn,
.ghost-btn,
.link-btn {
    min-height: 52px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
    white-space: nowrap;
}

.primary-btn {
    background: var(--primary);
}

.primary-btn:hover {
    background: var(--primary-dark);
}

.primary-btn:active,
.ghost-btn:active {
    transform: translateY(1px);
}

.ghost-btn {
    min-height: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #52627b;
    font-size: 15px;
    font-weight: 600;
}

.ghost-btn:hover {
    color: var(--primary);
}

.auth-submit {
    width: 100%;
    height: 54px;
}

.auth-submit:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.wechat-login-btn {
    width: 100%;
    height: 52px;
    margin-top: 12px;
    border: 1px solid #13b85f;
    border-radius: 12px;
    background: #10c363;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.wechat-login-btn:hover {
    background: #0fa855;
    color: #fff;
}

.wechat-login-btn:active {
    transform: translateY(1px);
}

.wechat-login-btn i {
    font-size: 22px;
    line-height: 1;
}

.auth-card-links {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.invite-note {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid rgba(79, 70, 229, .16);
    border-radius: 10px;
    background: #eef2ff;
    color: var(--primary);
    font-size: 13px;
    line-height: 1.45;
    font-weight: 700;
}

.auth-login .auth-submit::after {
    content: "";
}

.auth-register .auth-main,
.auth-reset .auth-main {
    min-height: 0;
}

.auth-register .auth-card,
.auth-reset .auth-card {
    padding-top: 28px;
    padding-bottom: 24px;
}

.auth-register .auth-card h2,
.auth-reset .auth-card h2 {
    font-size: 28px;
}

.auth-register .auth-card .hint,
.auth-reset .auth-card .hint {
    margin-bottom: 14px;
    padding-bottom: 12px;
}

.auth-register .auth-field,
.auth-reset .auth-field {
    margin-bottom: 10px;
}

.auth-register .auth-field input,
.auth-register .auth-field select,
.auth-reset .auth-field input,
.auth-reset .auth-field select {
    height: 44px;
    border-radius: 10px;
    font-size: 14px;
}

.auth-register .auth-field label,
.auth-reset .auth-field label {
    margin-bottom: 5px;
    font-size: 13px;
}

.auth-register .auth-submit,
.auth-reset .auth-submit {
    height: 46px;
    font-size: 16px;
}

@media(max-width: 860px) {
    html,
    body {
        height: 100%;
        overflow: hidden;
    }

    .auth-shell {
        width: 100%;
        min-height: 100svh;
        padding: 12px;
    }

    .auth-main {
        width: min(100%, 430px);
        min-height: 0;
        max-height: calc(100svh - 24px);
        border-radius: 16px;
        display: block;
        overflow: hidden;
    }

    .auth-card {
        padding: 22px 18px 18px;
    }

    .auth-card h2 {
        font-size: 25px;
    }

    .auth-card .hint {
        margin: 7px 0 14px;
        padding-bottom: 12px;
        font-size: 13px;
    }

    .auth-field {
        margin-bottom: 10px;
    }

    .auth-field label {
        margin-bottom: 4px;
        font-size: 12px;
    }

    .auth-field input,
    .auth-field select {
        height: 40px;
        padding: 0 11px;
        border-radius: 9px;
        font-size: 13px;
    }

    .auth-message {
        min-height: 17px;
        margin: -2px 0 7px;
        font-size: 12px;
    }

    .auth-submit,
    .primary-btn,
    .wechat-login-btn {
        height: 42px;
        min-height: 42px;
        border-radius: 9px;
        font-size: 15px;
    }

    .wechat-login-btn {
        margin-top: 8px;
    }

    .auth-card-links {
        margin-top: 10px;
    }

    .ghost-btn {
        min-height: auto;
        font-size: 13px;
    }

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

    .auth-register .full-line,
    .auth-reset .full-line {
        grid-column: span 1;
    }

    .auth-register .auth-card,
    .auth-reset .auth-card {
        padding: 14px 14px 12px;
    }

    .auth-register .auth-card h2,
    .auth-reset .auth-card h2 {
        font-size: 22px;
    }

    .auth-register .auth-card .hint,
    .auth-reset .auth-card .hint {
        margin-bottom: 8px;
        padding-bottom: 8px;
        line-height: 1.35;
    }

    .auth-register .auth-field,
    .auth-reset .auth-field {
        margin-bottom: 7px;
    }

    .auth-register .auth-field input,
    .auth-register .auth-field select,
    .auth-reset .auth-field input,
    .auth-reset .auth-field select {
        height: 34px;
        padding: 0 8px;
        font-size: 12px;
        border-radius: 8px;
    }

    .auth-register .auth-field label,
    .auth-reset .auth-field label {
        margin-bottom: 3px;
        font-size: 11px;
    }

    .auth-register .auth-submit,
    .auth-reset .auth-submit {
        height: 36px;
        min-height: 36px;
        font-size: 14px;
    }

    .invite-note {
        display: none;
    }
}

@media(max-width: 380px) {
    .auth-shell {
        padding: 8px;
    }

    .auth-main {
        max-height: calc(100svh - 16px);
    }

    .auth-card {
        padding: 16px 14px 14px;
    }

    .auth-card h2 {
        font-size: 22px;
    }

    .auth-card .hint {
        font-size: 12px;
    }

    .auth-register .auth-card,
    .auth-reset .auth-card {
        padding: 10px;
    }

    .auth-register .auth-card .hint,
    .auth-reset .auth-card .hint {
        display: none;
    }
}


.wechat-qr-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    padding: 24px;
    background: rgba(15, 23, 42, .42);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wechat-qr-modal[hidden] { display: none; }

.wechat-qr-panel {
    position: relative;
    width: min(380px, 100%);
    padding: 30px 28px 26px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 26px 80px rgba(15, 23, 42, .22);
    text-align: center;
}

.wechat-qr-panel h3 { margin: 0; color: #111827; font-size: 24px; line-height: 1.25; font-weight: 900; }
.wechat-qr-subtitle { margin: 10px 0 18px; color: #64748b; font-size: 14px; line-height: 1.65; }
.wechat-qr-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 10px; background: #f1f5f9; color: #0f172a; font-size: 24px; line-height: 1; cursor: pointer; }
.wechat-qr-box { position: relative; width: 260px; height: 260px; margin: 0 auto; border: 1px solid #e2e8f0; border-radius: 16px; background: #f8fafc; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.wechat-qr-box img { width: 236px; height: 236px; display: none; }
.wechat-qr-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #64748b; font-size: 14px; font-weight: 700; }
.wechat-qr-status { min-height: 22px; margin: 16px 0 14px; color: #52627b; font-size: 14px; font-weight: 700; }
.wechat-qr-status.is-success { color: var(--success); }
.wechat-qr-status.is-error { color: var(--danger); }
.wechat-qr-refresh { width: 100%; height: 44px; border: 1px solid #dbe3ef; border-radius: 12px; background: #fff; color: #172033; font-size: 15px; font-weight: 900; cursor: pointer; }
.wechat-qr-refresh:hover { border-color: var(--primary); color: var(--primary); }
