/* 与 Portfolio_Web(2)/pages/404 视觉一致；依赖 Main.css token */

body.error404-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.error404-body .site-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding-top: 0;
}

.error404-main {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 5vw, 48px) 16px clamp(40px, 8vw, 64px);
    box-sizing: border-box;
    overflow: hidden;
}

.error404-main .bg-glow {
    position: absolute;
    top: -180px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1400px, 200%);
    height: 900px;
    pointer-events: none;
    background:
        radial-gradient(circle at 30% 30%, rgba(52, 227, 244, 0.1), transparent 32%),
        radial-gradient(circle at 70% 28%, rgba(30, 107, 255, 0.12), transparent 34%);
    filter: blur(60px);
    z-index: 0;
}

#particles-404 {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

#particles-404 .star-404 {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 6px rgba(52, 227, 244, 0.35);
    animation: star404-twinkle var(--star-dur, 3s) ease-in-out infinite;
    animation-delay: var(--star-delay, 0s);
    opacity: 0;
}

@keyframes star404-twinkle {
    0%,
    100% {
        opacity: 0.15;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.6);
    }
}

@media (prefers-reduced-motion: reduce) {
    #particles-404 .star-404 {
        animation: none;
        opacity: 0.4;
    }

    .not-found-card {
        animation: none;
    }

    .not-found-card .not-found__orbit {
        animation: none;
    }
}

.not-found-card {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 520px;
    padding: clamp(40px, 6vw, 56px) clamp(28px, 5vw, 44px);
    text-align: center;
    border-radius: 28px;
    border: 1px solid var(--line-accent);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
        var(--bg-elevated, rgba(10, 14, 22, 0.88));
    box-shadow:
        0 24px 56px rgba(0, 0, 0, 0.45),
        0 0 40px rgba(37, 184, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: not-found-in 0.75s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)) forwards;
}

@keyframes not-found-in {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.not-found-card__code {
    margin: 0 0 8px;
    font-size: clamp(88px, 22vw, 118px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.06em;
    background: linear-gradient(
        135deg,
        #bff8ff 0%,
        var(--brand-aqua, #34e3f4) 28%,
        var(--brand-sky, #25b8ff) 58%,
        var(--brand-blue, #1e6bff) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    user-select: none;
}

.not-found-card .not-found__orbit {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    animation: orbit-float 3.2s ease-in-out infinite;
}

@keyframes orbit-float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.not-found-card .not-found__orbit svg {
    width: 68px;
    height: 68px;
    opacity: 0.9;
}

.not-found-card__title {
    margin: 0 0 10px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-1, rgba(255, 255, 255, 0.96));
}

.not-found-card__lead {
    margin: 0 0 32px;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-3, rgba(255, 255, 255, 0.42));
}

.not-found-card__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.not-found-card__actions .btn {
    width: min(260px, 100%);
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
}

.not-found-card__meta {
    margin-top: 36px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px 28px;
}

.not-found-card__meta a {
    font-size: 0.88rem;
    color: var(--text-3, rgba(255, 255, 255, 0.42));
    text-decoration: none;
    transition: color 0.2s ease;
}

.not-found-card__meta a:hover {
    color: var(--brand-aqua, #34e3f4);
}

.not-found-card__pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(52, 227, 244, 0.2);
    background: rgba(52, 227, 244, 0.06);
}

body.error404-body .site-footer {
    position: relative;
    z-index: 2;
}

/* 与 404 一致叠放；登录页页脚为 fixed 时仍用同一 z-index（由 login.css 覆盖 position） */
body.login-body .site-footer {
    z-index: 2;
}
