/* ============================================================
   外贸蓝海选品导航站 - 自定义样式
   Trade Navigation - Custom Styles
   ============================================================ */

/* ---- Base & Smooth Scroll ---- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* offset for fixed navbar */
}

/* ---- Selection ---- */
::selection {
    background-color: #1e40af;
    color: #ffffff;
}

/* ---- Navbar Scroll Effect ---- */
#navbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ---- Tool Card Hover ---- */
.tool-card {
    cursor: pointer;
}
.tool-card:hover {
    border-color: #bfdbfe;
}

/* ---- Article Card ---- */
.article-card {
    cursor: pointer;
}

/* ---- Nav Link Active State ---- */
.nav-link.active {
    color: #1e40af !important;
    background-color: #eff6ff !important;
    font-weight: 600;
}

/* ---- Mobile Menu ---- */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease;
    opacity: 0;
}
#mobile-menu.open {
    max-height: 500px;
    opacity: 1;
}

/* ---- Back to Top Button ---- */
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* ---- Fade-in on scroll (for sections) ---- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Tool card icon container ---- */
.tool-card .icon-wrapper {
    transition: transform 0.3s ease;
}
.tool-card:hover .icon-wrapper {
    transform: scale(1.1);
}

/* ---- Custom scrollbar (Webkit) ---- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ---- Focus styles for accessibility ---- */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- Print styles ---- */
@media print {
    header, footer, #back-to-top {
        display: none;
    }
    body {
        color: #000;
    }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---- Loading performance: prevent layout shift ---- */
img, svg {
    max-width: 100%;
    height: auto;
}

/* ---- Small screen tweaks ---- */
@media (max-width: 640px) {
    html {
        scroll-padding-top: 68px;
    }
    .tool-card {
        padding: 1.25rem;
    }
}

/* ---- Hero wave responsive ---- */
@media (max-width: 768px) {
    #hero-wave {
        height: 40px;
    }
}
