/* 首页壳层样式（Phase C 首轮抽取） */

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-shell-bg, #f4f3fb);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-logo {
    width: 100px;
    height: 100px;
    animation: homepageShellPulse 1.5s infinite ease-in-out;
}

.loader-spinner {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 4px solid var(--color-highlight-soft, rgba(87, 81, 213, 0.08));
    border-top: 4px solid var(--color-brand-600, #5751d5);
    border-radius: 50%;
    animation: homepageShellSpin 2s linear infinite;
}

@keyframes homepageShellSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes homepageShellPulse {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(0.95);
        opacity: 0.7;
    }
}

.homepage-heartbeat-once {
    animation: homepageSoftHeartbeat 0.9s ease-in-out 1;
}

@keyframes homepageSoftHeartbeat {
    0% {
        transform: translateY(0) scale(1);
    }

    30% {
        transform: translateY(-1px) scale(1.04);
    }

    60% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

.header-more-toggle {
    display: none;
}

.header-buttons .btn-mobile-only {
    display: none;
}

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

    .notification-text--mobile {
        display: none;
    }

    .header-buttons {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 4px;
    }

    .header-buttons .btn {
        display: inline-flex;
        flex: 0 0 auto;
    }

    header.header {
        position: relative;
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px 10px;
        min-height: 48px;
        flex-wrap: nowrap;
        flex-direction: row !important;
    }

    .header .logo img {
        height: 44px !important;
        width: auto !important;
    }

    .header .logo .logo-subtitle,
    .header .logo .logo-text {
        display: none !important;
    }

    .header .logo {
        min-height: 48px !important;
        padding-right: 0 !important;
    }

    .logo-container {
        width: auto !important;
        justify-content: flex-start !important;
        flex: 0 0 auto;
    }

    .header .user-info {
        width: auto !important;
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 6px;
        flex: 0 1 auto;
        justify-content: flex-end;
        flex-wrap: nowrap;
        overflow: hidden;
        overflow-x: auto;
        flex-direction: row !important;
    }

    .header .user-info > * {
        width: auto !important;
        flex: 0 0 auto;
    }

    .header .nav-points {
        height: 32px;
        padding: 0 8px;
        border-radius: 14px;
        font-size: 12px;
        line-height: 32px;
        flex-shrink: 0;
    }

    .btn-invite,
    .btn-info-center,
    .auth-buttons .btn {
        height: 32px;
        padding: 0 10px;
        font-size: 12px;
        border-radius: var(--radius-header-control, 11px);
    }

    .auth-buttons,
    .header .header-buttons {
        width: auto !important;
    }

    .auth-buttons .btn-login-register {
        white-space: nowrap;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .info-center-container {
        margin-right: 0;
        display: none !important;
    }

    #invite-btn {
        display: none !important;
    }

    .header-buttons .btn-mobile-only {
        display: inline-flex !important;
    }

    .header .header-buttons {
        display: none;
    }

    .header.more-open .header-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(120px, 1fr));
        gap: 10px;
        position: absolute;
        top: 60px;
        right: 14px;
        z-index: 3000;
        min-width: min(280px, 90vw);
        padding: 14px;
        overflow: visible;
        white-space: normal;
        background: var(--color-shell-nav-bg, rgba(255, 255, 255, 0.92));
        border: 1px solid var(--color-border, rgba(22, 22, 21, 0.08));
        border-radius: var(--radius-control, 12px);
        box-shadow: var(--shadow-shell-soft, 0 12px 28px rgba(87, 76, 180, 0.08));
    }

    .header.more-open .header-buttons::before {
        content: '';
        position: absolute;
        top: -10px;
        right: 28px;
        width: 18px;
        height: 18px;
        background: var(--color-shell-nav-bg, rgba(255, 255, 255, 0.92));
        border-left: 1px solid var(--color-border, rgba(22, 22, 21, 0.08));
        border-top: 1px solid var(--color-border, rgba(22, 22, 21, 0.08));
        transform: rotate(45deg);
        pointer-events: none;
    }

    .header-more-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-width: 46px;
        height: 40px;
        padding: 0 14px;
        border: 1px solid var(--color-border-strong, rgba(22, 22, 21, 0.14));
        border-radius: var(--radius-header-control, 11px);
        background: var(--color-shell-nav-bg, rgba(255, 255, 255, 0.92));
        color: var(--color-shell-text-soft, #4f4a6d);
        box-shadow: var(--button-shadow-header, 0 8px 16px rgba(20, 22, 35, 0.06));
        transition: all 0.24s ease;
        font-weight: 600;
    }

    .header-more-toggle i {
        color: var(--color-shell-brand, #5d55cb);
        font-size: 16px;
        transition: color 0.24s ease, transform 0.24s ease;
    }

    .header-more-toggle .more-label {
        display: inline-block;
        font-size: 12px;
        letter-spacing: 0.04em;
        color: inherit;
    }

    .header-more-toggle.is-open {
        border-color: var(--color-shell-border-strong, rgba(92, 85, 204, 0.22));
        background: var(--color-shell-pill-bg, rgba(92, 85, 204, 0.1));
        color: var(--color-shell-text-strong, #2b2758);
        box-shadow: var(--button-shadow-header-hover, 0 12px 20px rgba(20, 22, 35, 0.09));
    }

    .header-more-toggle.is-open i {
        color: var(--color-shell-text-strong, #2b2758);
        transform: rotate(90deg);
    }
}

@media (max-width: 420px) {
    .header.more-open .header-buttons {
        grid-template-columns: 1fr;
        right: 10px;
    }

    .header.more-open .header-buttons::before {
        right: 34px;
    }
}

@media (max-width: 480px) {
    .header .logo img {
        height: 40px !important;
        width: auto !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .homepage-heartbeat-once {
        animation: none;
    }
}
