/**
 * base-new.css
 * 站点 Header 相关样式（从 index.css 抽离）
 */

/* ==================== Header ==================== */
/* Skip link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 10000;
    padding: 0.5rem 1rem;
    background: #6713c9;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 1rem;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.site-header {
    border-bottom: 1px solid #e5e5e5;
}

.main-header.container,
.main-header {
    --header-margin: max(1rem, min(235px, calc((100vw - 298px - 619px) / 2)));
    --header-margin: 4.375rem;
    /* margin-left: var(--header-margin);
    margin-right: var(--header-margin); */
    padding-left: var(--header-margin);
    padding-right: var(--header-margin);
    /* width: calc(100vw - 2 * var(--header-margin)); */
    max-width: none;
    /* padding-left: 0;
    padding-right: 0; */
    min-height: 56px;
    height: 70px;
    box-sizing: border-box;
    justify-content: space-between;
}

.main-header>a{
    font-size: 0;
}

.main-header .logo {
    width: 206px;
    height: auto;
    margin-right: 0;
    object-fit: contain;
    object-position: left center;
}

.main-header .nav-list {
    gap: 40px;
}

.main-header .nav-item a {
    min-width: 7rem;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0 0.5rem;
    color: #333;
}
/*.main-header .nav-item a:hover,*/
/*.main-header .nav-item.dropdown:hover > a,*/
/*.main-header .nav-item.dropdown:focus-within > a {*/
/*    color: #fff;*/
/*    background-color: var(--theme-color);*/
/*}*/
/*.main-header .nav-item a:focus-visible,*/
/*.main-header .menu-toggle:focus-visible {*/
/*    outline: 2px solid var(--theme-color);*/
/*    outline-offset: 2px;*/
/*}*/

.nav-item a {
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.nav-item a:hover {
    color: #fff;
    border-color: var(--theme-color);
    box-shadow: 0 0 8px var(--theme-color),
    0 0 16px var(--theme-color);
}


.main-header .nav {
    flex-grow: 0;
    flex-shrink: 0;
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}


@media (prefers-reduced-motion: reduce) {
    .site-header *,
    .skip-link {
        transition: none !important;
    }
}

/* ==================== Back to Top 按钮（外框为滚动进度） ==================== */
.back-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: max(1.25rem, env(safe-area-inset-bottom, 1.25rem));
    width: 60px;
    height: 60px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: var(--theme-color);
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.back-to-top:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.back-to-top:active {
    transform: scale(0.98);
}
.back-to-top:focus-visible {
    outline: 2px solid var(--theme-color);
    outline-offset: 2px;
}

.back-to-top__progress {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
}
.back-to-top__svg {
    display: block;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.back-to-top__progress-bg {
    stroke: rgba(103, 19, 201, 0.25);
}
.back-to-top__progress-fill {
    stroke: var(--theme-color);
    stroke-dasharray: 100.53;
    stroke-dashoffset: 100.53;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.15s ease;
}
.back-to-top__icon {
    position: relative;
    z-index: 1;
    font-size: 1.25rem;
    line-height: 1;
    font-weight: 600;
}


@media (max-width: 1440px) {
    .fixed-item a{
        width: 80px;
    }
}

@media (max-width: 768px) {
    .main-header .logo {
        margin: 0 auto;
        height: 36px;
        z-index: 101;
    }

    body.nav-open {
        overflow: hidden;
    }
    .nav-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 9998;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    }
    body.nav-open .nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    .nav {
        position: fixed;
        top: 130px;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        visibility: hidden;
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.4s, max-height 0s linear 0.4s;
        text-align: left;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
        z-index: 9999;
    }
    .nav.open {
        max-height: calc(100vh - 60px);
        max-height: calc(100dvh - 60px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        visibility: visible;
        transform: translateY(0);
        transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.4s;
    }
    .nav-list > .nav-item {
        border-bottom: 1px solid #eee;
    }
    .nav-list {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .nav-item > a {
        font-size: 1rem;
        line-height: 1.35;
        padding: 0.75rem 1.25rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
    }
    /* 子菜单一律在父项下方展开，不向上弹出，避免遮挡顶部关闭按钮 */
    .dropdown-menu {
        position: static !important;
        top: auto !important;
        bottom: auto !important;
        padding-left: 1.25rem;
    }
    .dropdown-menu li a {
        font-size: 0.9375rem;
        line-height: 1.4;
        padding: 0.65rem 1.25rem;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
    }

    /* 写在 .nav 之后，确保覆盖：header 固定时 .nav 的 top 与 header 高度一致 */
    .site-header.fixed .nav {
        top: 4rem;
    }

    .fixed-item a,.back-to-top{
        width: 60px;
    }
}



