:root,
html[data-theme="light"] {
    color-scheme: light;
    --page: #fbfaf6;
    --page-soft: #f6f3eb;
    --surface: #ffffff;
    --ink: #17150f;
    --ink-soft: #5d5a51;
    --muted: #8d897e;
    --line: rgba(23, 21, 15, 0.11);
    --line-strong: rgba(23, 21, 15, 0.18);
    --accent: #ffb91c;
    --accent-strong: #e99a00;
    --accent-soft: #fff0b9;
    --accent-ink: #211a06;
    --green: #94bc58;
    --danger: #b94b3d;
    --shadow: 0 34px 100px rgba(64, 49, 8, 0.13), 0 8px 24px rgba(38, 31, 12, 0.08);
}

html[data-color-theme="blue"][data-theme="light"],
html[data-color-theme="blue"] {
    --page: #e8f1f6;
    --page-soft: #dce8f1;
    --surface: #ffffff;
    --ink: #163042;
    --ink-soft: #4d6778;
    --muted: #6b8494;
    --line: rgba(22, 48, 66, 0.12);
    --line-strong: rgba(22, 48, 66, 0.2);
    --accent: #4aa3c7;
    --accent-strong: #2e86ab;
    --accent-soft: #cfe8f3;
    --accent-ink: #102736;
    --green: #2d8a78;
    --shadow: 0 34px 100px rgba(22, 48, 66, 0.12), 0 8px 24px rgba(22, 48, 66, 0.08);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --page: #090906;
    --page-soft: #0f0f0b;
    --surface: #14140f;
    --ink: #f5f2e9;
    --ink-soft: #b9b5aa;
    --muted: #817e74;
    --line: rgba(255, 248, 225, 0.11);
    --line-strong: rgba(255, 248, 225, 0.19);
    --accent: #ffc329;
    --accent-strong: #f2a900;
    --accent-soft: #3a2b05;
    --accent-ink: #171205;
    --green: #a8cb69;
    --danger: #ff8e77;
    --shadow: 0 38px 120px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.35);
}

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

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

body.auth-page {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: "Manrope", "Noto Sans SC", "Microsoft YaHei", sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.auth-noise {
    display: none;
}

.auth-glow {
    position: fixed;
    z-index: 0;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(80px);
    opacity: 0.16;
    background: #ffd65a;
}

.auth-glow-one {
    top: 40px;
    left: -180px;
}

.auth-glow-two {
    right: -200px;
    bottom: -80px;
    background: #ff9a61;
}

.auth-back {
    position: fixed;
    z-index: 4;
    top: 22px;
    left: 22px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
}

.auth-back:hover {
    color: var(--ink);
}

.auth-back:focus-visible,
.auth-card button:focus-visible,
.auth-card a:focus-visible,
.auth-card input:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 68%, transparent);
    outline-offset: 3px;
}

.auth-shell {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    place-items: center;
    padding: 88px 20px 40px;
}

.auth-card {
    width: min(420px, 100%);
    padding: 32px 28px 24px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    text-align: center;
}

.auth-brand img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}

.auth-brand h1 {
    margin: 4px 0 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.auth-brand p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.6;
}

.auth-card form {
    display: grid;
    gap: 14px;
}

.auth-card label {
    display: grid;
    gap: 6px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 750;
}

.auth-card input {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}

.auth-card input::placeholder {
    color: var(--muted);
}

.auth-submit {
    width: 100%;
    min-height: 48px;
    margin-top: 6px;
    border: 0;
    border-radius: 14px;
    background: var(--accent);
    color: var(--accent-ink);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.auth-submit:hover {
    background: color-mix(in srgb, var(--accent) 88%, white);
}

.auth-submit:disabled {
    cursor: wait;
    opacity: 0.7;
}

.auth-error {
    min-height: 1.2em;
    margin: 0;
    color: var(--danger);
    font-size: 12px;
    text-align: center;
}

.auth-help {
    display: grid;
    gap: 6px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

.auth-help a {
    color: var(--ink-soft);
    font-weight: 650;
    text-decoration: none;
}

@media (max-width: 520px) {
    .auth-back {
        top: 16px;
        left: 16px;
    }

    .auth-card {
        padding: 26px 20px 20px;
        border-radius: 20px;
    }
}
