:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #0891b2;
    --secondary-hover: #0e7490;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #d1d5db;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #0f172a;
    --danger-bg: #fef2f2;
    --danger-text: #b91c1c;
    --success-bg: #f0fdf4;
    --success-text: #166534;
    --body-bg-start: #f5f7fa;
    --body-bg-end: #c3cfe2;
    --gold-icon: #FF8C00;
}

* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%; /* 确保宽度也是100% */
    margin: 0;
    padding: 0;
    overflow: hidden; /* 核心：禁止整个页面滚动，从而消除bounce效果 */
    overscroll-behavior: none; /* 现代CSS属性：专门用于禁用下拉刷新和边缘回弹 */
}

body {
    background: linear-gradient(135deg, var(--body-bg-start) 0%, var(--body-bg-end) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: relative;
    overflow-x: hidden;
    padding: 1rem;
}

/* Animated background decorations */
body::before, body::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
    animation: float 15s ease-in-out infinite alternate;
}

body::before {
    width: 350px;
    height: 350px;
    background: rgba(37, 99, 235, 0.1);
    top: 10%;
    left: 10%;
}

body::after {
    width: 300px;
    height: 300px;
    background: rgba(8, 145, 178, 0.1);
    bottom: 10%;
    right: 10%;
    animation-delay: -7s;
}

@keyframes float {
    from { transform: translate(0, 0) rotate(0deg); }
    to { transform: translate(40px, 60px) rotate(30deg); }
}

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

.auth-container {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out forwards;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: inline-block;
    
    /* --- 新增的渐变效果 --- */
    /* 1. 将渐变色设置为背景 */
    background: linear-gradient(135deg, #FFA500 0%, #FF8C00 100%);
    
    /* 2. 将背景裁剪为文字（图标）的形状 */
    -webkit-background-clip: text;
    background-clip: text;
    
    /* 3. 将文字（图标）的颜色设置为透明，以便透出下方的渐变背景 */
    -webkit-text-fill-color: transparent;
    
    /* 4. 为不支持渐变文本的旧浏览器提供一个纯色后备 */
    color: #FFA500; 
}

.auth-icon-login {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: inline-block;
    color: #FFA500; 
}

.auth-header h1 {
    color: var(--gray-900);
    font-weight: 700;
    font-size: 1.75rem;
    margin: 0;
}

.auth-header p {
    color: var(--gray-500);
    font-size: 0.95rem;
    margin: 0.5rem 0 0 0;
}

.form-container {
    display: none;
}

.form-container.active {
    display: block;
    animation: slideUp 0.4s ease-out;
}

.form-group-icon {
    position: relative;
    margin-bottom: 1.25rem;
}

.form-group-icon .bi {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1.1rem;
    transition: color 0.3s ease;
    pointer-events: none;
}

.form-control {
    border-radius: 0.75rem;
    padding: 0.75rem 1rem 0.75rem 3rem; /* Left padding for icon */
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    height: 52px;
    box-shadow: none;
    font-size: 1rem;
    background-color: var(--gray-50);
    color: var(--gray-700);
    width: 100%;
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-group-icon:focus-within .bi {
    color: var(--primary-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.verification-code-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.verification-code-group input {
    flex: 1;
    padding-left: 1rem; /* No icon, so normal padding */
}

.verification-code-group button {
    white-space: nowrap;
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0; /* Prevent button from shrinking */
}

.verification-code-group button:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

.btn-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
    font-size: 1rem;
    height: 52px;
    box-shadow: 0 4px 15px -5px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 7px 20px -5px rgba(37, 99, 235, 0.4);
}

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

.alert {
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    border: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    animation: slideUp 0.3s ease-out;
    display: flex;
    align-items: center;
}
.alert .bi {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.alert-danger { background-color: var(--danger-bg); color: var(--danger-text); }
.alert-success { background-color: var(--success-bg); color: var(--success-text); }

.switch-form-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 1.5rem;
}

.switch-form-text .switch-link {
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.switch-form-text .switch-link:hover {
    text-decoration: underline;
}

/* Profile Page Specific Styles */
.profile-container {
    max-width: 540px;
}
.form-section {
    margin-bottom: 2rem;
}
.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
    font-size: 1rem;
    height: 52px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    line-height: 1.5;
}

.btn-secondary:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
    transform: translateY(-2px);
    color: var(--gray-900);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions .btn-submit, .form-actions .btn-secondary {
    margin: 0;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    body {
        padding: 0;
        align-items: flex-start; 
    }

    .auth-container {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        min-height: 100vh;
        border-radius: 0;
        padding: 2rem 1.5rem;
        box-shadow: none;
        

        display: block;
        overflow-y: auto;
    }


    .auth-header h1 {
        font-size: 1.5rem;
    }
    .form-control, .btn-submit, .btn-secondary, .verification-code-group button {
        height: 48px;
        font-size: 0.95rem;
    }
    .verification-code-group {
        flex-direction: row; 
    }
    .verification-code-group button {
        width: auto; 
    }
}


.form-actions {
    display: flex;
    flex-direction: row-reverse; /* Puts "Save" button on the right */
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions .btn-submit, 
.form-actions .btn-secondary {
    margin: 0;
    flex: 1; /* Make both buttons take up equal space */
}