/* 公共导航栏响应式样式 - 由 header.html 组件使用 */
/* 此文件需与 components/header.html 配合加载 */

:root {
    --cnaes-blue: #2563eb;
    --cnaes-ink: #071a3d;
}

/* 顶部链接栏 */
.top-links-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 60;
    background: linear-gradient(90deg, rgba(7, 26, 61, 0.96), rgba(15, 76, 201, 0.92));
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(147, 197, 253, 0.24);
    box-shadow: 0 14px 32px rgba(7, 26, 61, 0.22);
}

.top-links-inner {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0.5rem 2rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    flex-wrap: wrap;
    text-align: right;
}

.top-links-inner a {
    color: #ffffff;
    font-weight: 500;
    transition: color 0.2s ease;
}

.top-links-inner a:hover {
    color: #bfdbfe;
}

/* 主导航Header */
#topHeader {
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: 50;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(238, 245, 255, 0.58));
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(147, 197, 253, 0.24);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
}

/* 站点标题 */
#site-title {
    font-family: 'Noto Sans SC', "Microsoft YaHei", sans-serif;
    font-size: 30px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 2px;
    color: var(--cnaes-ink, #071a3d);
    text-shadow: 0 2px 0 rgba(255,255,255,0.78), 0 8px 22px rgba(37, 99, 235, 0.12);
}

#site-subtitle {
    font-size: 9px;
    color: var(--cnaes-blue, #2563eb);
    opacity: 0.9;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 4px;
}

/* 导航容器 */
.header-nav-container {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(239, 246, 255, 0.72));
    backdrop-filter: blur(12px);
    border-radius: 9999px;
    padding: 0 18px;
    height: 40px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(191, 219, 254, 0.72);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.nav-link {
    color: #333333;
    font-weight: 600;
    font-size: 11px;
    padding: 0 15px;
    height: 40px;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    position: relative;
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    color: var(--cnaes-blue, #2563eb);
    background-color: rgba(255, 255, 255, 0.94);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--cnaes-blue, #2563eb);
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

/* 工具区 */
.header-tools {
    display: flex;
    align-items: center;
}

.header-tools a {
    color: #333333;
    font-weight: 500;
    text-decoration: none;
}

.header-tools a:hover {
    color: var(--cnaes-blue, #2563eb);
}

/* 下拉菜单 */
.dropdown-menu {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 55;
    min-width: 180px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(191, 219, 254, 0.4);
    overflow: hidden;
}

.group:hover .dropdown-menu {
    display: block;
}

/* 移动端快捷导航 */
.mobile-quick-nav {
    display: none;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(239, 246, 255, 0.88));
    border-bottom: 1px solid rgba(147, 197, 253, 0.2);
    padding: 6px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.mobile-quick-nav::-webkit-scrollbar {
    display: none;
}

.mobile-quick-nav a {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #333333;
    white-space: nowrap;
    text-decoration: none;
    border-radius: 9999px;
    margin: 0 3px;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.6);
}

.mobile-quick-nav a:hover,
.mobile-quick-nav a:active {
    color: var(--cnaes-blue, #2563eb);
    background: rgba(255, 255, 255, 0.95);
}

/* 响应式 */
@media (max-width: 1536px) {
    #site-title { font-size: 24px; letter-spacing: 1px; }
    #site-subtitle { font-size: 8px; }
    .nav-link { padding: 0 10px; font-size: 10px; }
    .header-nav-container { padding: 0 10px; }
}

@media (max-width: 1024px) {
    #topHeader {
        height: auto !important;
        min-height: 3.5rem !important;
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
        position: relative;
        top: 0;
    }
    #topHeader > div {
        flex-direction: column;
        gap: 8px;
    }
    #topHeader .header-nav-container {
        display: none;
    }
    #topHeader .header-tools {
        font-size: 12px !important;
    }
    #topHeader .header-tools .min-w-\[124px\] {
        display: none;
    }
    #topHeader .mobile-quick-nav {
        display: flex !important;
        scrollbar-width: none;
    }
    #site-title {
        font-size: 20px !important;
        letter-spacing: 1px !important;
    }
    #site-subtitle {
        font-size: 7px !important;
    }
    .top-links-bar {
        display: none;
    }
    .top-links-inner {
        padding: 0.3rem 1rem;
        font-size: 10px;
    }
}

@media (max-width: 768px) {
    #topHeader {
        position: relative;
        top: 0;
    }
    #topHeader > div {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    #site-title {
        font-size: 17px !important;
    }
    #site-subtitle {
        font-size: 6px !important;
    }
    #topHeader img.logo-pulse {
        height: 40px !important;
        width: 40px !important;
    }
    .mobile-quick-nav a {
        padding: 5px 10px;
        font-size: 11px;
        min-height: 34px;
    }
}

@media (max-width: 375px) {
    #topHeader .mobile-quick-nav a {
        padding-left: 0.625rem !important;
        padding-right: 0.625rem !important;
        font-size: 11px !important;
    }
}

/* 页面主体偏移 - 为固定header留出空间 */
body.has-site-header {
    padding-top: 160px;
}

@media (max-width: 1024px) {
    body.has-site-header {
        padding-top: 0;
    }
}