/* 官网导航切换 — 加载条 + 页面进入动画 */
.portal-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 10002;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.portal-page-loader__bar {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #0d6efd 0%, #0aa2c0 55%, #20c997 100%);
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.35);
}

.portal-page-loader.is-active {
    opacity: 1;
}

.portal-page-loader.is-active .portal-page-loader__bar {
    animation: portalLoaderBar 0.72s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes portalLoaderBar {
    0% { width: 0; }
    55% { width: 72%; }
    100% { width: 92%; }
}

.portal-page {
    opacity: 0;
}

.portal-page.is-ready {
    animation: portalPageEnter 0.52s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes portalPageEnter {
    to {
        opacity: 1;
    }
}

.portal-page.is-ready .jumbotron {
    animation: portalSectionEnter 0.48s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}

.portal-page.is-ready .pages,
.portal-page.is-ready .site-home,
.portal-page.is-ready .footer,
.portal-page.is-ready .portal-footer {
    animation: portalSectionEnter 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

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

.portal-page.is-ready .course-card {
    animation: portalCardEnter 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.portal-page.is-ready .course-card:nth-child(1) { animation-delay: 0.14s; }
.portal-page.is-ready .course-card:nth-child(2) { animation-delay: 0.18s; }
.portal-page.is-ready .course-card:nth-child(3) { animation-delay: 0.22s; }
.portal-page.is-ready .course-card:nth-child(4) { animation-delay: 0.26s; }
.portal-page.is-ready .course-card:nth-child(n+5) { animation-delay: 0.3s; }

@keyframes portalCardEnter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

body.portal-nav-leaving .portal-page {
    opacity: 0.55;
    transition: opacity 0.24s ease;
}

body.portal-nav-leaving .portal-page-loader {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .portal-page,
    .portal-page.is-ready,
    .portal-page.is-ready .jumbotron,
    .portal-page.is-ready .pages,
    .portal-page.is-ready .site-home,
    .portal-page.is-ready .footer,
    .portal-page.is-ready .portal-footer,
    .portal-page.is-ready .course-card {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .portal-page-loader,
    .portal-page-loader.is-active .portal-page-loader__bar {
        animation: none !important;
        display: none !important;
    }
}

/* 门户 — 跳过导航（与考试中心 ec-skip-link 行为一致） */
.portal-skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 10003;
    padding: 10px 16px;
    background: #1890ff;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 8px 0;
}
.portal-skip-link:focus {
    position: fixed;
    left: 0;
    top: 0;
    width: auto;
    height: auto;
    overflow: visible;
    outline: 2px solid #fff;
    outline-offset: 2px;
}
