/* === nav-top.css === */
/* ========== 基础变量 ========== */
:root {
    --header-height: 70px;
    --primary-bg: #052050;
    --white: #ffffff;
    --border-color: #e5e7eb;
    --text-dark: #333333;
    --primary-blue: #0044bd;
}

/* ========== Header 容器 ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--primary-bg);
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* 非首页/滚动时的样式：白色半透明背景 */
.header.header-light {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.header-inner .logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.header-inner .logo img {
    height: 28px;
    width: auto;
    display: block;
}

/* ========== 桌面导航 ========== */
.nav-desktop {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 100%;
}

.nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    overflow: visible !important;
}

/* 默认针对深色背景（首页） */
.nav-link {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--white);
    border-radius: 6px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: normal;
    transition: background 0.2s, color 0.2s;
}

/* 按钮重置：消除浏览器默认外观，与 a.nav-link 保持一致 */
button.nav-link {
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    line-height: inherit;
}

.nav-link:hover,
.nav-link.active,
.nav-link:focus,
.nav-link:visited,
button.nav-link:focus-visible {
    color: var(--white) !important;
    background: rgba(255, 255, 255, 0.15);
}

button.nav-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* 浅色背景下的样式覆盖 */
.header.header-light .nav-link {
    color: var(--primary-blue);
    background: transparent;
}

.header.header-light .nav-link:hover,
.header.header-light .nav-link.active,
.header.header-light .nav-link:focus,
.header.header-light .nav-link:visited {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-blue) !important;
}

.has-dropdown::after {
    content: '▼';
    font-size: 10px;
    margin-left: 4px;
    transition: transform 0.2s;
}

.nav-item:hover .has-dropdown::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    padding: 10px;
    z-index: 10000;
    display: none;
}

.nav-item:hover .dropdown-menu {
    display: block !important;
}

.dropdown-item {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 2px;
}

.dropdown-item:hover {
    background: #f0f0f0;
    color: #0044bd;
}

.dropdown-item.active {
    background: #e6f0ff;
    color: #0044bd;
    font-weight: bold;
}

.nav-cta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--primary-blue);
    margin: 5px 0;
    transition: background 0.3s;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--white);
    padding: 20px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    z-index: 9998;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav-link {
    display: block;
    padding: 10px 0;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #eee;
}

.mobile-sub-link {
    padding-left: 20px;
    font-size: 0.9em;
    color: #666;
}

@media (max-width: 768px) {
    .nav-desktop { display: none !important; }
    .mobile-menu-btn { display: block !important; }
}

/* ============================================================
   关键布局样式（提取自 deferred.css，避免异步加载时的 CLS）
   这些样式定义页面主体结构，同步加载确保首帧布局稳定
   ============================================================ */

/* 容器：全站统一的宽度限制与居中 */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* 主内容区：保证最短高度，防止页脚在短页面浮动 */
.main {
    min-height: calc(100vh - 517px);
}

/* Page Header：页面顶部标题区，首屏最显眼的视觉元素 */
.page-header {
    padding: calc(var(--header-height) + 60px) 0 60px;
    background: linear-gradient(135deg, rgba(0, 47, 108, 0.92) 0%, rgba(0, 102, 204, 0.92) 100%);
    color: var(--bg-white);
    text-align: center;
    margin-top: 20px;
}

.page-header h1 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    margin-bottom: 16px;
}

.page-header p {
    font-size: 18px;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

