:root {
    --auth-bg: #f6f5f1;
    --auth-card: #ffffff;
    --auth-text: #11110f;
    --auth-muted: #6f6d66;
    --auth-line: #e5e0d8;
    --auth-soft: #efede7;
    --auth-black: #111111;
    --auth-accent: #ff5b14;
    --auth-radius: 12px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--auth-bg);
}

body.auth-page {
    margin: 0;
    color: var(--auth-text);
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
    background: var(--auth-bg);
    letter-spacing: 0;
}

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

button,
input {
    font: inherit;
}

.auth-header {
    position: fixed;
    z-index: 20;
    top: 0;
    right: 0;
    left: 0;
    height: 69px;
    border-bottom: 1px solid transparent;
    background: rgba(246, 245, 241, 0.88);
    backdrop-filter: blur(16px);
}

.auth-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    width: min(1280px, calc(100% - 32px));
    height: 68px;
    margin: 0 auto;
}

.auth-brand {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 9px;
    min-width: 118px;
    font-weight: 800;
    line-height: 1;
}

.auth-brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, #ff5b14 0%, #e52d11 55%, #151515 56%);
    font-size: 12px;
    box-shadow: 0 8px 18px rgba(229, 45, 17, 0.24);
}

.auth-brand small {
    display: block;
    margin-top: 4px;
    color: var(--auth-muted);
    font-size: 10px;
    font-weight: 600;
}

.auth-nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 2px;
}

.auth-nav-links a,
.auth-nav-actions a,
.auth-nav-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    padding: 0 16px;
    color: #282723;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
}

.auth-nav-links a:hover,
.auth-nav-actions a:hover,
.auth-nav-actions button:hover {
    background: rgba(17, 17, 17, 0.06);
}

.auth-nav-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
}

.workspace-link {
    border: 1px solid var(--auth-line);
    background: #fff;
    box-shadow: 0 1px 0 rgba(17, 17, 17, 0.04);
}

.lang-button::after {
    content: "⌄";
    margin-left: 8px;
    color: var(--auth-muted);
}

.auth-main {
    display: flex;
    min-height: 735px;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

.register-main {
    min-height: 588px;
}

.auth-card {
    width: 400px;
    max-width: calc(100vw - 32px);
    border: 1px solid var(--auth-line);
    border-radius: var(--auth-radius);
    background: var(--auth-card);
    box-shadow: 0 1px 2px rgba(17, 17, 17, 0.05), 0 24px 60px rgba(17, 17, 17, 0.06);
    overflow: hidden;
}

.auth-card-head {
    padding: 24px 24px 18px;
    text-align: center;
}

.auth-card-head h1 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
}

.auth-card-head p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 14px;
}

.auth-card-body {
    padding: 0 24px 24px;
}

.auth-error {
    margin: 0 0 12px;
    border: 1px solid #ffc7b8;
    border-radius: 8px;
    padding: 10px 12px;
    color: #a72e14;
    background: #fff0eb;
    font-size: 13px;
}

.google-button,
.submit-button,
.code-row button {
    display: inline-flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--auth-line);
    background: #fff;
    color: var(--auth-text);
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.google-button {
    position: relative;
    gap: 10px;
    padding: 0 12px;
}

.google-button span {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: conic-gradient(from 60deg, #4285f4, #34a853, #fbbc05, #ea4335, #4285f4);
    font-size: 12px;
    font-weight: 800;
}

.google-button strong {
    font-size: 14px;
    font-weight: 600;
}

.google-button em {
    position: absolute;
    right: 12px;
    color: var(--auth-muted);
    font-size: 12px;
    font-style: normal;
}

.google-button:hover,
.code-row button:hover {
    border-color: #d2ccc1;
    background: #faf9f6;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0;
    color: var(--auth-muted);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--auth-line);
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: 36px;
    margin-bottom: 16px;
    border-radius: 9px;
    background: var(--auth-soft);
    padding: 4px;
}

.auth-tab {
    border: 0;
    border-radius: 7px;
    color: var(--auth-muted);
    background: transparent;
    font-size: 13px;
    cursor: pointer;
}

.auth-tab.active {
    color: var(--auth-text);
    background: #fff;
    box-shadow: 0 1px 2px rgba(17, 17, 17, 0.08);
}

.auth-form {
    display: none;
    gap: 16px;
}

.auth-form.active {
    display: grid;
}

.compact-form {
    gap: 16px;
}

.auth-form label {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.auth-form label > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--auth-text);
    font-size: 14px;
    font-weight: 600;
}

.auth-form label a {
    color: var(--auth-muted);
    font-size: 12px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.auth-form input {
    width: 100%;
    min-width: 0;
    height: 36px;
    border: 1px solid var(--auth-line);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--auth-text);
    background: #fff;
    outline: none;
}

.auth-form input:focus {
    border-color: #bcb5a8;
    box-shadow: 0 0 0 3px rgba(255, 91, 20, 0.12);
}

.code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 8px;
}

.code-row button {
    min-height: 36px;
    font-size: 13px;
}

.submit-button {
    border-color: var(--auth-black);
    color: #fff;
    background: var(--auth-black);
    font-weight: 600;
}

.submit-button:hover {
    background: #2a2926;
    transform: translateY(-1px);
}

.switch-auth {
    margin: 16px 0 0;
    color: var(--auth-muted);
    text-align: center;
    font-size: 14px;
}

.switch-auth a {
    color: var(--auth-text);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.auth-footer {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 16px 0 36px;
}

.footer-brand {
    position: relative;
    height: 230px;
    overflow: hidden;
    user-select: none;
}

.footer-brand span {
    position: absolute;
    left: 0;
    bottom: -12px;
    color: rgba(17, 17, 17, 0.05);
    font-size: 146px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.footer-brand strong {
    position: absolute;
    left: 2px;
    top: 44px;
    font-size: 18px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 42px;
    border-top: 1px solid var(--auth-line);
    padding-top: 36px;
}

.footer-grid h2 {
    margin: 0 0 14px;
    font-size: 14px;
}

.footer-grid a {
    display: block;
    margin: 0 0 12px;
    color: var(--auth-muted);
    font-size: 14px;
}

.copyright {
    margin: 28px 0 0;
    color: var(--auth-muted);
    font-size: 13px;
}

@media (max-width: 980px) {
    .auth-nav {
        justify-content: space-between;
    }

    .auth-nav-links {
        display: none;
    }

    .auth-footer {
        padding-top: 0;
    }

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

@media (max-width: 640px) {
    .auth-header {
        height: 64px;
    }

    .auth-nav {
        width: calc(100% - 24px);
        height: 64px;
    }

    .auth-nav-actions {
        gap: 4px;
    }

    .auth-nav-actions button {
        display: none;
    }

    .workspace-link {
        padding: 0 12px;
    }

    .auth-main {
        min-height: 650px;
        padding: 84px 12px 36px;
    }

    .register-main {
        min-height: 560px;
    }

    .auth-card-head,
    .auth-card-body {
        padding-right: 18px;
        padding-left: 18px;
    }

    .footer-brand {
        height: 120px;
    }

    .footer-brand span {
        font-size: 70px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}
