/* ============================================
   来薪水 Design System
   Confident Modern Enterprise Aesthetic
   ============================================ */

/* --- Design Tokens --- */
:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #818cf8;
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-rgb: 79, 70, 229;
    --secondary: #10b981;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --accent-rgb: 245, 158, 11;
    --light: #fafaf9;
    --dark: #0f172a;
    --dark-2: #1e293b;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light-gray: #e2e8f0;
    --border-color: #e2e8f0;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 16px;
    --r-xl: 24px;
    --s-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --s-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --s-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --s-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background-color: var(--light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--primary-100);
    color: var(--primary-dark);
}

/* --- Container --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Navigation --- */
header {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.3s var(--ease);
}

header.scrolled {
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-links li {
    margin-left: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    padding: 8px 16px;
    border-radius: var(--r-sm);
    position: relative;
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform 0.25s var(--ease);
}

.nav-links a:hover {
    color: var(--primary);
    background: var(--primary-50);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
}

.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

#userName {
    margin-right: 4px;
    font-weight: 500;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 8px;
    border-radius: var(--r-sm);
    transition: background 0.2s;
}

.mobile-menu-btn:hover {
    background: var(--primary-50);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 22px;
    border-radius: var(--r-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    border: none;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.35);
    transform: translateY(-1px);
}

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

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-50);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* --- Footer --- */
footer {
    background: var(--dark);
    color: white;
    padding: 64px 0 24px;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 48px;
    margin-bottom: 48px;
}

.footer-column h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
    letter-spacing: 0.01em;
}

.footer-column p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.7;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
}

.footer-links a:hover {
    color: white;
    transform: translateX(3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.35);
    font-size: 13px;
}

/* --- Auth Pages (Login/Register) --- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    position: relative;
    padding: 20px;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.06), transparent 70%);
    pointer-events: none;
}

.login-container::after {
    content: '';
    position: absolute;
    bottom: -15%;
    left: -5%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.05), transparent 70%);
    pointer-events: none;
}

.login-box {
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--s-xl);
    width: 100%;
    max-width: 420px;
    padding: 40px 32px;
    position: relative;
    z-index: 1;
}

.login-box.with-banner {
    max-width: 920px;
    display: flex;
    padding: 0;
    overflow: hidden;
}

.login-banner {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
    color: white;
    padding: 56px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 24px 24px;
}

.login-banner::after {
    content: '';
    position: absolute;
    bottom: -80px;
    right: -80px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.login-banner h2 {
    font-size: 32px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.login-banner p {
    font-size: 15px;
    line-height: 1.7;
    opacity: 0.85;
    position: relative;
    z-index: 1;
    margin-bottom: 28px;
}

.banner-features {
    list-style: none;
    position: relative;
    z-index: 1;
}

.banner-features li {
    margin-bottom: 14px;
    font-size: 14px;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.banner-features li i {
    margin-right: 10px;
    color: var(--accent);
    font-size: 16px;
}

.login-form-wrapper {
    flex: 0 0 440px;
    padding: 48px 40px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

.login-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

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

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

.form-control {
    width: 100%;
    padding: 11px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--r-sm);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    background: var(--surface);
    color: var(--text-primary);
}

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

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.form-group.error .form-control {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.form-group.error .error-message {
    display: block;
}

.error-message {
    display: none;
    color: #ef4444;
    font-size: 13px;
    margin-top: 6px;
    font-weight: 500;
}

/* Captcha */
.captcha-container {
    display: flex;
    gap: 12px;
}

.captcha-image {
    flex-shrink: 0;
    width: 110px;
    height: 44px;
    background: var(--light);
    border: 1.5px solid var(--border-color);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s;
    overflow: hidden;
}

.captcha-image:hover {
    border-color: var(--primary);
}

.captcha-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.checkbox-group label {
    margin: 0;
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    line-height: 1.5;
}

.checkbox-group label a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.checkbox-group label a:hover {
    text-decoration: underline;
}

.checkbox-group.error label {
    color: #ef4444;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--r-sm);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    font-family: inherit;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.3);
}

.btn-submit:hover {
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.35);
    transform: translateY(-1px);
}

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

.btn-submit:disabled {
    background: var(--light-gray);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Back Link */
.back-link {
    text-align: center;
    margin-top: 16px;
}

.back-link a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.back-link a:hover {
    color: var(--primary);
}

/* --- Tabs --- */
.tab-buttons {
    display: flex;
    background: var(--light);
    border-radius: var(--r-md);
    padding: 4px;
    margin-bottom: 30px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: all 0.25s var(--ease);
}

.tab-btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--s-sm);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--surface);
    border-radius: var(--r-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    min-width: 300px;
    max-width: 420px;
    animation: slideIn 0.35s var(--ease);
    transition: all 0.3s var(--ease);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.toast.hiding {
    opacity: 0;
    transform: translateX(100%);
}

.toast.removing {
    display: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
}

.toast-icon.success {
    background: #ecfdf5;
    color: #059669;
}

.toast-icon.error {
    background: #fef2f2;
    color: #dc2626;
}

.toast-icon.warning {
    background: #fffbeb;
    color: #d97706;
}

.toast-icon.info {
    background: #eff6ff;
    color: #2563eb;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.toast-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-light);
    transition: color 0.2s;
    flex-shrink: 0;
    font-size: 12px;
    border-radius: 50%;
}

.toast-close:hover {
    color: var(--text-primary);
    background: var(--light);
}

/* --- Loading Overlay --- */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.6s var(--ease) forwards;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* --- Responsive --- */
@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 850px) {
    .login-box.with-banner {
        flex-direction: column;
        max-width: 460px;
    }

    .login-banner {
        padding: 40px 32px;
        text-align: center;
    }

    .banner-features {
        display: none;
    }

    .login-form-wrapper {
        flex: auto;
        padding: 36px 28px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 0;
        gap: 0;
    }

    .mobile-menu-btn {
        display: block;
        margin-left: auto;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 16px 0;
        border-top: 1px solid var(--border-color);
        gap: 4px;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: 10px 16px;
        border-radius: var(--r-sm);
    }

    .nav-links a::after {
        display: none;
    }

    .nav-buttons {
        display: none;
        width: 100%;
        padding: 12px 0 4px;
        border-top: 1px solid var(--border-color);
        gap: 8px;
    }

    .nav-links.active + .nav-buttons {
        display: flex;
    }

    .nav-buttons .btn {
        flex: 1;
    }

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

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .login-box {
        padding: 32px 20px;
    }

    .login-header h1 {
        font-size: 22px;
    }

    .toast-container {
        left: 12px;
        right: 12px;
        top: 12px;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }

    .captcha-container {
        flex-direction: column;
    }

    .captcha-image {
        width: 100%;
        height: 48px;
    }
}
