/* ========== 导航栏样式 ========== */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    z-index: 1000;
    padding: 0 24px;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a5f2a;
    letter-spacing: 1px;
    text-decoration: none;
}

.nav-title:hover {
    color: #2d8a3e;
}

/* 下拉菜单容器 */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 菜单项（按钮） */
.nav-item {
    position: relative;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.25s ease;
    cursor: pointer;
    white-space: nowrap;
    border: none;
    background: none;
    font-family: inherit;
}

.nav-item:hover {
    background: rgba(26,95,42,0.08);
    color: #1a5f2a;
}

.nav-item.active {
    background: #1a5f2a;
    color: white;
}

/* 下拉框 - 上下册各自的下拉内容 */
.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    max-height: 70vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s ease;
    padding: 8px 0;
    margin-top: 4px;
    z-index: 1001;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #c1d9c6 transparent;
}

/* 滚动条样式（webkit内核） */
.nav-dropdown::-webkit-scrollbar {
    width: 4px;
}
.nav-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.nav-dropdown::-webkit-scrollbar-thumb {
    background: #c1d9c6;
    border-radius: 4px;
}
.nav-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a3c4ab;
}

/* 下拉框内部填充空隙，防止鼠标离开时消失 */
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

/* 子菜单出现 */
.nav-item:hover .nav-dropdown,
.nav-dropdown:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 下拉框内部章节列表 */
.dropdown-section {
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.dropdown-section:last-child {
    border-bottom: none;
}

.dropdown-section-title {
    padding: 6px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #1a5f2a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-link {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-link:hover {
    background: rgba(26,95,42,0.08);
    color: #1a5f2a;
    padding-left: 20px;
}

.dropdown-link.current {
    background: rgba(26,95,42,0.12);
    color: #1a5f2a;
    font-weight: 500;
}

/* 返回首页按钮 */
.nav-home {
    padding: 8px 16px;
    font-size: 14px;
    color: #555;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.25s ease;
}

.nav-home:hover {
    background: rgba(26,95,42,0.08);
    color: #1a5f2a;
}

/* 响应式 */
@media (max-width: 768px) {
    .nav-bar {
        padding: 0 12px;
    }

    .nav-title {
        font-size: 14px;
    }

    .nav-item {
        padding: 6px 10px;
        font-size: 12px;
    }

    .nav-dropdown {
        min-width: 160px;
    }

    .dropdown-link {
        font-size: 12px;
        padding: 6px 12px;
    }
}
