/* Screwtech - Custom Styles */

body {
    font-family: "Inter", sans-serif;
}

h1, h2, h3, .brand-font {
    font-family: "Manrope", sans-serif;
}

/* Header states */
.site-header {
    transition: background-color 0.35s ease, border-color 0.35s ease;
}

/* Top bar above main nav — fixes dropdown hover stolen by lower row */
.site-header__topbar {
    position: relative;
    z-index: 30;
}

.site-header__mainnav {
    position: relative;
    z-index: 20;
}

.site-header__topbar-menu {
    z-index: 40;
}

/* Bridge pointer gap between top-bar trigger and dropdown (pt-2) */
.site-header__topbar .group > .site-header__topbar-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -0.625rem;
    height: 0.625rem;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.68) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    z-index: -1;
    opacity: 1;
    transition: opacity 0.35s ease;
}

.site-header.scrolled::before {
    opacity: 0;
}

.site-header .nav-link,
.site-header .top-bar-link {
    transition: color 0.35s ease;
}

.site-header.at-top {
    background-color: transparent !important;
    border-bottom: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.site-header.at-top .nav-link,
.site-header.at-top .top-bar-link {
    color: rgba(255, 255, 255, 0.88);
}

.site-header.at-top .nav-link:hover,
.site-header.at-top .top-bar-link:hover {
    color: #ffffff;
}

.site-header.at-top .nav-link.is-active,
.site-header.at-top .top-bar-link.is-active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.14);
}

.site-header.at-top .nav-separator {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.site-header.scrolled .nav-link {
    color: rgb(51 65 85);
}

.site-header.scrolled .top-bar-link {
    color: rgb(71 85 105);
}

.site-header.scrolled .nav-link:hover,
.site-header.scrolled .top-bar-link:hover {
    color: rgb(23 60 114);
}

.site-header.scrolled .nav-link.is-active,
.site-header.scrolled .top-bar-link.is-active {
    color: rgb(23 60 114);
    background-color: rgba(0, 31, 70, 0.08);
}

.site-header.scrolled {
    background-color: rgba(255, 255, 255, 0.97) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.site-logo-light,
.site-logo-dark {
    transition: opacity 0.35s ease;
}

.site-logo-dark {
    opacity: 0;
    position: absolute;
}

.site-header.scrolled .site-logo-dark {
    opacity: 1;
}

.site-header.scrolled .site-logo-light {
    opacity: 0;
}

/* 在线选型：Hero 顶栏半透明；滚动后（PC）主色胶囊 */
.site-header .nav-cta {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transition: background-color 0.35s ease, color 0.35s ease;
}

.site-header .nav-cta:hover,
.site-header .nav-cta:focus {
    background-color: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}

.site-header.scrolled .nav-cta {
    background-color: #001f46 !important;
    color: #ffffff !important;
}

.site-header.scrolled .nav-cta:hover,
.site-header.scrolled .nav-cta:focus {
    background-color: #1a355e !important;
    color: #ffffff !important;
}

.site-header .nav-cta .material-symbols-outlined {
    font-size: 1rem;
    line-height: 1;
}

/* Mobile menu toggle icons */
.site-header.at-top #mobile-toggle {
    color: white;
}

.site-header.scrolled #mobile-toggle {
    color: rgb(51 65 85);
}

/* Mobile menu panel */
#mobile-menu details > summary::-webkit-details-marker {
    display: none;
}

#mobile-menu details > summary::marker {
    content: "";
}

@media (max-width: 1023px) {
    .mobile-menu:not(.hidden) {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        z-index: 60;
        max-height: calc(100dvh - 4.5rem);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    }

    .site-header.at-top .mobile-menu:not(.hidden) {
        background-color: #001f46;
        border-top-color: rgba(255, 255, 255, 0.12);
    }

    .site-header.scrolled .mobile-menu:not(.hidden) {
        background-color: #ffffff;
        border-top-color: rgba(148, 163, 184, 0.35);
    }
}

.site-header.at-top #mobile-menu {
    border-top-color: rgba(255, 255, 255, 0.12);
}

.site-header.at-top #mobile-menu .mobile-nav-link,
.site-header.at-top #mobile-menu .mobile-nav-sublink,
.site-header.at-top #mobile-menu details > summary {
    color: #ffffff;
}

.site-header.at-top #mobile-menu details > summary .material-symbols-outlined,
.site-header.at-top #mobile-menu .mobile-nav-link .material-symbols-outlined {
    color: rgba(255, 255, 255, 0.88);
}

.site-header.at-top #mobile-menu .mobile-nav-link.is-active,
.site-header.at-top #mobile-menu .mobile-nav-sublink.is-active,
.site-header.at-top #mobile-menu details > summary.is-active {
    background-color: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.site-header.at-top #mobile-menu .mobile-nav-link:hover,
.site-header.at-top #mobile-menu .mobile-nav-sublink:hover,
.site-header.at-top #mobile-menu details > summary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.site-header.at-top #mobile-menu details[open] > div {
    background-color: rgba(0, 0, 0, 0.18);
    border-radius: 0.625rem;
    margin: 0.125rem 0 0.25rem;
    padding-top: 0.25rem;
    padding-bottom: 0.375rem;
}

.site-header.at-top #mobile-menu .mobile-nav-sublink {
    color: rgba(255, 255, 255, 0.92);
}

.site-header.at-top #mobile-menu .mobile-menu-extra {
    border-top-color: rgba(255, 255, 255, 0.16);
}

.site-header.at-top #mobile-menu a.mobile-nav-cta {
    background-color: rgba(255, 255, 255, 0.18) !important;
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff !important;
}

.site-header.at-top #mobile-menu a.rounded-full[class*="bg-white"] {
    background-color: rgba(255, 255, 255, 0.18) !important;
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff !important;
}

.site-header.scrolled #mobile-menu {
    background-color: #ffffff;
    border-top-color: rgba(148, 163, 184, 0.35);
}

.site-header.scrolled #mobile-menu .mobile-nav-link,
.site-header.scrolled #mobile-menu .mobile-nav-sublink,
.site-header.scrolled #mobile-menu details > summary {
    color: #1e293b;
}

.site-header.scrolled #mobile-menu .mobile-nav-link:hover,
.site-header.scrolled #mobile-menu .mobile-nav-sublink:hover,
.site-header.scrolled #mobile-menu details > summary:hover {
    background-color: #f1f3ff;
    color: #001f46;
}

.site-header.scrolled #mobile-menu .mobile-nav-link.is-active,
.site-header.scrolled #mobile-menu .mobile-nav-sublink.is-active,
.site-header.scrolled #mobile-menu details > summary.is-active {
    background-color: #f1f3ff;
    color: #001f46;
}

.site-header.scrolled #mobile-menu details[open] > div {
    background-color: #f8f9ff;
    border-radius: 0.625rem;
    margin: 0.125rem 0 0.25rem;
}

.site-header.scrolled #mobile-menu .mobile-menu-extra {
    border-top-color: rgba(148, 163, 184, 0.25);
}

.site-header.scrolled #mobile-menu a.mobile-nav-cta,
.site-header.scrolled #mobile-menu a.rounded-full[class*="bg-white"],
.site-header.scrolled #mobile-menu a[href*="selection"] {
    background-color: #001f46 !important;
    color: #ffffff !important;
    border: none;
}

.site-header.scrolled #mobile-menu a[href*="selection"]:hover,
.site-header.scrolled #mobile-menu a.mobile-nav-cta:hover,
.site-header.scrolled #mobile-menu a.rounded-full[class*="bg-white"]:hover {
    background-color: #1a355e !important;
}

/* Homepage hero banner slideshow */
.hero-banner-slideshow {
    z-index: 0;
}

.hero-banner-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    animation: heroBannerCrossfade 12s ease-in-out infinite;
}

.hero-banner-slide:nth-child(2) {
    animation-delay: -6s;
}

.hero-banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center right;
    opacity: 0.82;
}

.home-hero .hero-bg {
    z-index: 1;
    background: linear-gradient(
        90deg,
        rgba(0, 31, 70, 0.93) 0%,
        rgba(0, 31, 70, 0.8) 36%,
        rgba(0, 45, 98, 0.55) 62%,
        rgba(0, 31, 70, 0.28) 100%
    );
}

.home-hero .hero-glow,
.home-hero .hero-animated-bg {
    z-index: 2;
}

@keyframes heroBannerCrossfade {
    0%, 42% { opacity: 1; }
    50%, 92% { opacity: 0; }
    100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-banner-slide {
        animation: none;
    }

    .hero-banner-slide:first-child {
        opacity: 1;
    }

    .hero-banner-slide:last-child {
        opacity: 0;
    }
}

/* Hero animations */
.hero-animated-bg {
    animation: heroDrift 18s ease-in-out infinite alternate;
    transform-origin: center center;
    will-change: transform;
}

.hero-glow {
    background:
        radial-gradient(circle at 18% 24%, rgba(107, 200, 255, 0.28), transparent 42%),
        radial-gradient(circle at 82% 72%, rgba(255, 255, 255, 0.12), transparent 38%);
    animation: heroGlowPulse 9s ease-in-out infinite;
    pointer-events: none;
}

@keyframes heroDrift {
    0% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.05) translate(-1%, 1%); }
    100% { transform: scale(1) translate(1%, -1%); }
}

@keyframes heroGlowPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.hero-fade-in {
    opacity: 0;
    transform: translateY(24px);
    animation: fadeSlideUp 0.8s ease forwards;
}

@keyframes fadeSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Back to top */
.back-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    min-width: 3rem;
    padding: 0.625rem 0.75rem;
    border: none;
    border-radius: 0.75rem;
    background-color: #001f46;
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 31, 70, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease,
        transform 0.3s ease,
        background-color 0.2s ease;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
    background-color: #1a355e;
    outline: none;
}

.back-to-top .material-symbols-outlined {
    font-size: 1.375rem;
    line-height: 1;
}

.back-to-top__label {
    white-space: nowrap;
}

@media (max-width: 639px) {
    .back-to-top {
        right: 1rem;
        bottom: 1rem;
        padding: 0.5rem;
        min-width: 2.75rem;
        border-radius: 9999px;
    }

    .back-to-top__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f3ff;
}

::-webkit-scrollbar-thumb {
    background: #c4c6d0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #74777f;
}

/* Selection color */
::selection {
    background: #65d7ff;
    color: #001f46;
}

/* News article body — unified typography for migrated content */
.news-content {
    width: 100%;
    color: #44474f;
    font-size: 1rem;
    line-height: 1.875;
}

.news-content p {
    margin: 0 0 1.25rem;
    text-align: justify;
    text-indent: 0;
}

.news-content p:last-child {
    margin-bottom: 0;
}

.news-content p:has(img) {
    margin: 1.75rem 0;
    text-align: center;
    text-indent: 0;
}

.news-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 0.75rem;
    border: 1px solid rgba(196, 198, 208, 0.6);
}

/* Bottom CTA banner — shared background image */
.page-cta-banner {
    position: relative;
    overflow: hidden;
    min-height: 280px;
}

@media (min-width: 768px) {
    .page-cta-banner {
        min-height: 360px;
    }
}

.page-cta-banner__bg {
    position: absolute;
    inset: 0;
}

.page-cta-banner__bg::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.96) 0%,
        rgba(255, 255, 255, 0.88) 42%,
        rgba(255, 255, 255, 0.35) 68%,
        rgba(255, 255, 255, 0.08) 100%
    );
    pointer-events: none;
}

.page-cta-banner__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
}

.page-cta-banner__content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    min-height: inherit;
}

.page-cta-banner__inner {
    max-width: 36rem;
}

.page-cta-banner__inner > a.inline-flex {
    text-decoration: none;
}

/* Mobile — card layout, image band on top */
@media (max-width: 767px) {
    .page-cta-banner {
        display: flex;
        flex-direction: column;
        min-height: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 1.5rem !important;
        background: #eef1f8;
    }

    .page-cta-banner__bg {
        position: relative;
        inset: auto;
        height: 7rem;
        flex-shrink: 0;
    }

    .page-cta-banner__bg::before {
        background: linear-gradient(
            180deg,
            rgba(0, 31, 70, 0.08) 0%,
            rgba(238, 241, 248, 0.4) 55%,
            #eef1f8 100%
        );
    }

    .page-cta-banner__bg img {
        object-position: center 35%;
    }

    .page-cta-banner__content {
        min-height: 0;
        padding-left: 1rem;
        padding-right: 1rem;
        margin-top: -0.75rem;
    }

    .page-cta-banner__inner {
        max-width: none;
        width: 100%;
        padding: 1.25rem 1.125rem 1.375rem;
        border-radius: 1rem;
        background: #ffffff;
        border: 1px solid rgba(0, 31, 70, 0.08);
        box-shadow:
            0 4px 6px -2px rgba(0, 31, 70, 0.06),
            0 12px 28px -8px rgba(0, 31, 70, 0.12);
    }

    .page-cta-banner__inner h2 {
        font-size: 1.25rem !important;
        line-height: 1.35 !important;
        margin-bottom: 0.5rem !important;
        color: #011b3f;
    }

    .page-cta-banner__inner p {
        font-size: 0.875rem !important;
        line-height: 1.65 !important;
        margin-bottom: 1rem !important;
        color: #4b5563;
    }

    .page-cta-banner__inner > a.inline-flex {
        width: 100%;
        justify-content: center;
        padding: 0.6875rem 1.25rem !important;
        font-size: 0.9375rem;
        border-radius: 9999px;
    }
}

.pagination-modern {
    padding-left: 0;
    margin: 0;
    list-style: none;
}

.pagination-modern li {
    display: inline-flex;
}

.pagination-modern li a,
.pagination-modern li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0 0.875rem;
    border-radius: 9999px;
    border: 1px solid rgba(0, 31, 70, 0.12);
    background: #fff;
    color: #4b5b71;
    transition: all 0.2s ease;
}

.pagination-modern li a:hover,
.pagination-modern li span:hover,
.pagination-modern li.active a,
.pagination-modern li.active span {
    color: #001f46;
    border-color: rgba(0, 31, 70, 0.22);
    background: rgba(0, 31, 70, 0.06);
}

.pagination-modern li.pagination-ellipsis span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0 0.5rem;
    border: none;
    background: transparent;
    color: #4b5b71;
    letter-spacing: 0.15em;
    user-select: none;
}

