/* ==========================================================================
   skin/css/header.css
   首页与所有栏目页共用的顶部导航样式（唯一真源）。

   依赖说明：本文件自带 --header-height 变量，不依赖 style.css。
   - 栏目页：先加载 style.css（含全局变量/内容样式），再加载 header.css。
   - 首页：仅加载 home-template.css（Tailwind 内容样式）+ header.css（头部样式），
     二者互不污染全局基础样式，确保首页与栏目页头部像素级一致。
   ========================================================================== */

:root {
    --header-height: 72px;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
}

.site-header .container {
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
    height: 100%;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #194376;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: #194376;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 22px;
    height: 22px;
}

.logo-icon .logo-img {
    width: 100%;
    height: 100%;
    /* object-fit: contain; */
    /* border-radius: 4px; */
}

.logo-text {
    line-height: 1.15;
    display: flex;
    flex-direction: column;
}

.logo-text-1 {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: 0.02em;
}

.logo-text-2 {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 100%;
}

.main-nav a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: #194376;
}

.main-nav a.active {
    font-weight: 600;
}

.main-nav a.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 2px;
    background: #b12525;
    border-radius: 1px;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    color: #194376;
    font-size: 24px;
    align-items: center;
    justify-content: center;
}

/* ===== 移动端 ===== */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .menu-toggle {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        gap: 4px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
    }

    .main-nav.open {
        transform: translateY(0);
    }

    .main-nav a {
        height: auto;
        padding: 12px 16px;
        border-bottom: 1px solid #e5e7eb;
    }

    .main-nav a:last-child {
        border-bottom: none;
    }
}
