/* 自定义样式 */
:root {
    --primary-color: #0056b3;
    --secondary-color: #6c757d;
    --hover-color: #003d7a;
    --active-color: #e9f5ff;
}

body {
    padding-top: 70px; /* 为固定导航条留出空间 */
}

.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0;
    background-color: white;
    position: fixed; /* 固定在顶部 */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: 70px; /* 增加导航条高度 */
}

.container-fluid {
    padding: 0 15px;
    height: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    height: 70px;
    padding: 0 15px;
}

.navbar-brand img {
    height: 40px;
    margin-right: 10px;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-text small {
    font-size: 0.7rem;
    color: var(--secondary-color);
}

/* 导航项样式 - 关键修改 */
.nav-item {
    position: static; /* 重要：确保下拉菜单定位正确 */
}

.nav-link {
    font-weight: 500;
    color: #333;
    height: 70px; /* 与导航条同高 */
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: relative;
    margin: 0 15px; /* 增加导航标签间距 */
}

.nav-item:hover .nav-link {
    color: var(--primary-color);
}

/* 全屏下拉菜单样式 */
.full-width-dropdown .dropdown-menu {
    width: 100vw;
    left: 0 !important;
    right: 0 !important;
    margin-left: calc(-50vw + 50%) !important;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
    display: none;
    position: absolute;
    top: 70px; /* 导航条高度 */
    z-index: 1020;
}

.dropdown-content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
}

.dropdown-content {
    display: flex;
}

.dropdown-links {
    flex: 0 0 75%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.dropdown-links a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
    border-radius: 4px;
}

/* 子菜单项悬停效果 */
.dropdown-links a:hover,
.dropdown-links a:focus,
.dropdown-links a.active {
    background-color: var(--active-color);
    color: var(--primary-color);
    font-weight: 500;
}

.dropdown-links i {
    margin-right: 8px;
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.dropdown-featured {
    flex: 0 0 25%;
    padding-left: 40px;
    border-left: 1px solid #dee2e6;
}

.featured-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.featured-title {
    font-weight: bold;
    margin: 10px 0 5px;
    font-size: 1.1rem;
}

.featured-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-block;
    margin-top: 5px;
}

.featured-link a:hover {
    text-decoration: underline;
}

.search-box {
    position: relative;
    margin-left: 15px;
    height: 70px;
    display: flex;
    align-items: center;
}

.search-box input {
    padding-right: 35px;
    border-radius: 20px;
    min-width: 200px;
}

.search-box button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--secondary-color);
}

/* 主要内容区域 */
.main-content {
    padding-top: 20px;
    position: relative;
    z-index: 1010;
}

@media (max-width: 992px) {
    body {
        padding-top: 60px;
    }

    .navbar {
        height: 60px;
    }

    .navbar-brand {
        height: 60px;
    }

    .navbar-collapse {
        background-color: white;
        padding: 15px;
        margin-top: 0;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
    }

    .nav-link {
        height: auto;
        padding: 10px 0;
        margin: 0;
    }

    .full-width-dropdown .dropdown-menu {
        position: static !important;
        width: 100% !important;
        margin-left: 0 !important;
        top: auto;
        box-shadow: none;
    }

    .dropdown-content {
        flex-direction: column;
    }

    .dropdown-links {
        grid-template-columns: repeat(2, 1fr);
    }

    .dropdown-featured {
        padding-left: 0;
        padding-top: 1rem;
        border-left: none;
        border-top: 1px solid #dee2e6;
        margin-top: 1rem;
    }

    .search-box {
        margin: 10px 0 0;
        width: 100%;
        height: auto;
    }
}

@media (max-width: 768px) {
    .dropdown-links {
        grid-template-columns: 1fr;
    }
}