/* 登录页面样式 */
:root {
    --auth-page: #f4f6f8;
    --auth-surface: #fcfcfd;
    --auth-text: #262b33;
    --auth-muted: #626a76;
    --auth-border: #dfe3e8;
    --auth-accent: #e85f5f;
    --auth-accent-hover: #d94e4e;
    --auth-focus: rgba(232, 95, 95, 0.18);
}

.login-page, .register-page {
    margin: 0;
    padding: 0;
    min-height: 100dvh;
    background: var(--auth-page);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--auth-surface);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 18px 48px rgba(44, 50, 59, 0.11);
    border: 1px solid var(--auth-border);
    animation: slideUp 0.6s ease-out;
    width: 100%;
    max-width: 400px;
}

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

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 600;
    color: var(--auth-text);
}

.login-header .subtitle {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: var(--auth-muted);
    font-weight: 400;
}

.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--auth-text);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--auth-border);
    background: var(--auth-surface);
    color: var(--auth-text);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px var(--auth-focus);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--auth-muted);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-radius: 3px;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--auth-accent);
    border-color: var(--auth-accent);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: #fdfdfd;
    font-size: 12px;
    font-weight: bold;
}

.forgot-password {
    color: var(--auth-accent-hover);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: var(--auth-accent);
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--auth-accent);
    color: #fdfdfd;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 20px;
}

.login-btn:hover {
    background: var(--auth-accent-hover);
}

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

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

.register-link a {
    color: var(--auth-accent-hover);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.register-link a:hover {
    color: var(--auth-accent);
    text-decoration: underline;
}

/* 注册模态框样式 */
.register-modal {
    width: 90%;
    max-width: 400px;
    padding: 30px;
}

.register-modal .form-group {
    margin-bottom: 18px;
}

.register-btn {
    width: 100%;
    padding: 12px;
    background: var(--auth-accent);
    color: #fdfdfd;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.register-btn:hover {
    background: var(--auth-accent-hover);
}

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

/* 响应式设计 */
@media (max-width: 480px) {
    .login-container {
        padding: 15px;
    }
    
    .login-card {
        padding: 30px 25px;
    }
    
    .login-header .logo h1 {
        font-size: 24px;
    }
    
    .login-header h2 {
        font-size: 20px;
    }
}

/* 错误提示样式 */
.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #c53030;
}

.success-message {
    background: #c6f6d5;
    color: #2f855a;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #2f855a;
}

.auth-brand-avatar {
    width: 64px;
    height: 64px;
    display: block;
    margin: 0 auto 16px;
    object-fit: contain;
}

.generated-username-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.generated-username-field input[readonly] {
    background: #f1f3f6;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.regenerate-username-btn {
    min-width: 76px;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    background: var(--auth-surface);
    color: var(--auth-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.regenerate-username-btn:hover {
    border-color: var(--auth-accent);
    color: var(--auth-accent-hover);
}

.regenerate-username-btn:disabled,
.login-btn:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.form-helper,
.account-recovery-note {
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.55;
}

.form-helper {
    margin: 7px 0 0;
}

.account-recovery-note {
    margin: -8px 0 20px;
    text-align: center;
}

@media (prefers-color-scheme: dark) {
    :root {
        --auth-page: #17191d;
        --auth-surface: #22252b;
        --auth-text: #f0f1f3;
        --auth-muted: #b7bdc7;
        --auth-border: #414650;
        --auth-accent: #e96a6a;
        --auth-accent-hover: #f07878;
        --auth-focus: rgba(233, 106, 106, 0.24);
    }

    .generated-username-field input[readonly] {
        background: #2b2f36;
    }

    .error-message {
        background: #3a2428;
        color: #ffb5bd;
        border-left-color: #ef7b88;
    }

    .success-message {
        background: #20352c;
        color: #a8e7c8;
        border-left-color: #65c99a;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-card {
        animation: none;
    }
}
.optional-label {
    margin-left: 6px;
    color: #91978a;
    font-size: 11px;
    font-weight: 600;
}

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

.verification-code-button {
    min-width: 112px;
    padding: 0 14px;
    border: 1px solid #dfe3d8;
    border-radius: 10px;
    background: #f8f9f3;
    color: #3f491f;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.verification-code-button:hover:not(:disabled) {
    border-color: #c6d83b;
    background: #f4f6de;
}

.verification-code-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

@media (max-width: 520px) {
    .verification-code-row {
        grid-template-columns: 1fr;
    }

    .verification-code-button {
        min-height: 43px;
    }
}
