:root {
    --auth-primary: #2563eb;
    --auth-primary-dark: #1d4ed8;
    --auth-secondary: #7c3aed;
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-card-bg: rgba(255, 255, 255, 0.92);
    --auth-border: rgba(148, 163, 184, 0.4);
    --auth-icon: #1e293b;
    --auth-icon-muted: #94a3b8;
    --auth-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    --auth-radius: 18px;
    --auth-brand-primary: #007aff;
    --auth-brand-secondary: #8e8e93;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', 'PingFang SC', 'Microsoft Yahei', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 45%, #7c3aed 100%);
    color: var(--auth-text);
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.25), transparent 55%),
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.2), transparent 50%),
    radial-gradient(circle at 10% 90%, rgba(59, 130, 246, 0.18), transparent 60%);
    pointer-events: none;
    z-index: -1;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.auth-header {
    position: absolute;
    display: flex;
    align-items: center;
    color: #0f172a;
    text-decoration: none;
}

.auth-header .brand-logo {
    width: 120px;
    height: auto;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 0;
    background: none;
    padding: 0;
    box-shadow: none;
    filter: drop-shadow(0 18px 36px rgba(15, 23, 42, 0.3));
}

.auth-header .brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.auth-header .brand-text .brand-name-english {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    font-style: italic;
    color: #58cd7f;
    letter-spacing: 0.5px;
    line-height: 1;
    text-shadow: 0 16px 38px rgba(15, 23, 42, 0.25);
}

.auth-header .brand-text .brand-name-chinese {
    font-size: 1.4rem;
    font-weight: 500;
    color: #c5c5c6;
    line-height: 1;
    text-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
}

@media (max-width: 1024px) {
    .auth-header {
        top: 40px;
        left: 40px;
        gap: 16px;
    }

    .auth-header .brand-logo {
        width: 108px;
    }

    .auth-header .brand-text .brand-name-english {
        font-size: 2rem;
    }

    .auth-header .brand-text .brand-name-chinese {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .auth-header {
        position: static;
        margin: 16px auto 12px;
        justify-content: center;
        flex-direction: column;
        text-align: center;
    }

    .auth-page {
        padding-top: 24px;
    }

    .auth-header .brand-logo {
        width: 96px;
        filter: drop-shadow(0 12px 28px rgba(15, 23, 42, 0.25));
    }

    .auth-header .brand-text {
        align-items: center;
        gap: 4px;
    }

    .auth-header .brand-text .brand-name-english {
        font-size: 1.8rem;
    }

    .auth-header .brand-text .brand-name-chinese {
        font-size: 1.1rem;
    }
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 140px 64px 120px;
    gap: 64px;
}

.auth-illustration {
    max-width: 520px;
    color: #f8fafc;
}

.auth-illustration h1 {
    font-size: 44px;
    line-height: 1.2;
    margin: 0 0 24px;
    text-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
}

.auth-illustration p {
    font-size: 18px;
    line-height: 1.7;
    margin: 0 0 24px;
    color: rgba(241, 245, 249, 0.85);
}

.auth-illustration .feature-list {
    display: grid;
    gap: 12px;
    margin-top: 32px;
}

.auth-illustration .feature-item {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.2);
    backdrop-filter: blur(4px);
    font-size: 15px;
}

.auth-panel {
    width: 420px;
    max-width: 100%;
}

.auth-card {
    background: var(--auth-card-bg);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    padding: 40px;
    backdrop-filter: blur(12px);
    border: 1px solid var(--auth-border);
}

.auth-card h2 {
    margin: 0 0 12px;
    font-size: 30px;
    color: #0f172a;
}

.auth-card .auth-subtitle {
    margin: 0 0 32px;
    color: var(--auth-muted);
    font-size: 16px;
}

.auth-form {
    display: grid;
    gap: 0;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-field + .form-field {
    margin-top: 0;
}

.auth-form input {
    padding: 13px 0;
    border: none;
    background: transparent;
    font-size: 15px;
    width: 100%;
    line-height: 1.5;
}

.auth-form input:focus {
    outline: none;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.95);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    min-height: 48px;
}

.input-wrapper:focus-within {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
    background: rgba(255, 255, 255, 1);
}

.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-icon);
    flex-shrink: 0;
}

.input-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    display: block;
}

.input-toggle {
    border: none;
    background: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--auth-icon-muted);
    flex-shrink: 0;
    transition: color 0.2s ease, box-shadow 0.2s ease;
    border-radius: 999px;
}

.input-toggle svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    display: block;
}

.input-toggle .icon-eye-open {
    display: none;
}

.input-toggle.is-visible .icon-eye-open {
    display: block;
}

.input-toggle.is-visible .icon-eye-closed {
    display: none;
}

.input-toggle:focus-visible {
    outline: none;
    color: var(--auth-icon-muted);
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.35);
}

.form-field.has-error .input-wrapper {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.18);
}

.form-field.has-error .input-icon,
.form-field.has-error .input-toggle {
    color: #dc2626;
}

.field-error {
    font-size: 13px;
    color: #dc2626;
    margin: 0 4px;
    line-height: 1.4;
    min-height: 20px;
    display: flex;
    align-items: center;
    padding-top: 4px;
}

.field-error:empty {
    visibility: hidden;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-secondary));
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.35);
}

.auth-submit:active {
    transform: translateY(0);
}

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

.auth-switch a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    color: var(--auth-primary-dark);
}

.captcha-field,
.code-field {
    gap: 8px;
}

.captcha-input-group,
.code-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-input-group .input-wrapper,
.code-input-group .input-wrapper {
    flex: 1 1 auto;
    min-height: 48px;
}

.captcha-field .captcha-image {
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: #f8fafc;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    width: 140px;
    height: 46px;
    object-fit: cover;
}

.captcha-field .captcha-image:focus,
.captcha-field .captcha-image:hover {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
    transform: translateY(-1px);
}

.send-code-button {
    padding: 0 18px;
    min-width: 132px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(37, 99, 235, 0.65);
    background: rgba(37, 99, 235, 0.08);
    color: var(--auth-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.send-code-button:hover {
    background: rgba(37, 99, 235, 0.16);
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.22);
}

.send-code-button:active {
    transform: translateY(0);
}

.send-code-button:disabled {
    cursor: not-allowed;
    background: rgba(148, 163, 184, 0.18);
    border-color: rgba(148, 163, 184, 0.4);
    color: rgba(100, 116, 139, 0.8);
    box-shadow: none;
}

.auth-footer {
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(8px);
}

.auth-footer .footer {
    margin: 0;
    padding: 24px 0;
}

@media (max-width: 1100px) {
    .auth-main {
        flex-direction: column;
        align-items: center;
        padding: 32px 24px 88px;
        text-align: center;
    }

    /* 当宽度不足以同时展示左右两侧时，隐藏左侧说明 */
    .auth-illustration {
        display: none;
    }

    /* 品牌区从左侧过渡到居中，位于表单上方 */
    .auth-header {
        position: static;
        margin: 16px auto 12px;
        justify-content: center;
        flex-direction: column;
        text-align: center;
    }

    .auth-illustration {
        max-width: 640px;
    }

    .auth-panel {
        width: min(480px, 100%);
    }

    .auth-card {
        padding: 32px;
    }

    .auth-illustration .feature-list {
        justify-items: center;
    }
}

@media (max-width: 600px) {
    .form-field input {
        width: 100%;
    }

    .captcha-input-group .captcha-image,
    .code-input-group {
        align-self: stretch;
    }

    .captcha-input-group,
    .code-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .send-code-button {
        width: 100%;
    }
}

.auth-toast {
    position: fixed;
    top: 32px;
    right: 32px;
    padding: 12px 20px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.95);
    color: #f8fafc;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
    opacity: 0;
    transform: translateY(-16px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1200;
}

.auth-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.auth-toast.success {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.auth-toast.error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

@media (max-width: 768px) {
    .auth-illustration {
        display: none;
    }

    .auth-main {
        padding: 24px 16px 80px;
    }
}

@media (max-width: 720px) {
    body::before {
        background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.2), transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.18), transparent 40%);
    }

    .auth-header {
        top: 28px;
        left: 24px;
    }

    .auth-main {
        padding: 24px 20px 72px;
        gap: 24px;
    }

    .auth-card {
        padding: 28px 24px;
    }
}