/* 苹果风格导航栏 */
.apple-navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0 10px;
}

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

.nav-logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1d1d1f;
    text-decoration: none;
    display: flex;
    align-items: center;
    letter-spacing: -0.5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.nav-logo i {
    margin-right: 8px;
    color: #2997ff;
}

.nav-links {
    display: flex;
    list-style: none;
    height: 100%;
    background: transparent;
    /* 默认状态下透明背景 */
}

.nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 48px;
    left: 0;
    width: 100%;
    background: rgba(245, 245, 247, 0.95);
    /* 确保有浅灰色背景 */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1002;
    border-radius: 0 0 20px 20px;
}

.nav-item {
    position: relative;
    height: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0 14px;
    height: 100%;
    color: #6e6e73;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 400;
    transition: color 0.2s ease;
    position: relative;
    letter-spacing: -0.02em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.nav-link:hover {
    color: #1d1d1f;
}

.nav-link.active {
    color: #1d1d1f;
    font-weight: 500;
}

/* 宽幅下拉菜单 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(245, 245, 247, 0.88);
    min-width: 100%;
    width: 900px;
    /* 固定宽度而不是全屏宽度 */
    max-width: 900px;
    /* 限制最大宽度 */
    border-radius: 0 0 16px 16px;
    box-shadow: 0 12px 28px 0 rgba(0, 0, 0, 0.1), 
                0 2px 6px 0 rgba(0, 0, 0, 0.07),
                inset 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 20px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1001;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow-x: auto;
    /* 添加横向滚动条 */
    max-height: 60vh;
    /* 设置最大高度，超过则出现纵向滚动 */
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content {
    width: 100%;
    /* 内容宽度适应容器 */
    display: flex;
    padding: 0 40px;
}

.dropdown-column {
    flex: 1;
    min-width: 200px;
    padding: 0 20px;
}

.dropdown-column h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #d2d2d7;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.dropdown-item {
    display: block;
    padding: 10px 0;
    color: #1d1d1f;
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    letter-spacing: -0.01em;
}

.dropdown-item:hover {
    color: #2997ff;
}

.dropdown-item i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background-color: #d2d2d7;
    margin: 12px 0;
}

/* 二级下拉菜单 */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .submenu {
    position: absolute;
    left: 100%;
    top: 0;
    background: rgba(245, 245, 247, 0.88);
    min-width: 250px;
    border-radius: 10px;
    box-shadow: 0 12px 28px 0 rgba(0, 0, 0, 0.1), 
                0 2px 6px 0 rgba(0, 0, 0, 0.07),
                inset 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s ease;
    z-index: 1002;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.dropdown-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.nav-actions {
    display: flex;
    align-items: center;
}

.nav-icon {
    color: #6e6e73;
    text-decoration: none;
    font-size: 0.9rem;
    margin-left: 20px;
    transition: color 0.2s ease;
}

.nav-icon:hover {
    color: #1d1d1f;
}

/* 移动端底部导航 */
.bottom-navigation {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    align-items: center;
    justify-content: space-around;
}

.bottom-nav-container {
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: space-around;
    align-items: center;
}

.nav-link-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    flex: 1;
    color: #86868b;
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
}

.nav-link-mobile.active,
.nav-link-mobile:hover {
    color: #0071e3;
}

.nav-icon {
    font-size: 18px;
}

@media (max-width: 768px) {
    .apple-navbar {
        padding: 0 16px;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        font-size: 18px;
        cursor: pointer;
        color: #1d1d1f;
        padding: 8px;
        border-radius: 6px;
        transition: background 0.3s;
    }

    .mobile-menu-btn:hover {
        background: rgba(0, 0, 0, 0.05);
    }

    .bottom-navigation {
        display: flex;
    }

    .nav-actions {
        display: none;
    }

    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        background: rgba(245, 245, 247, 0.95);
    }

    .dropdown-menu.show {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        max-height: calc(100vh - 48px);
        overflow-y: auto;
        background: rgba(245, 245, 247, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 1001;
    }

    .dropdown-content {
        display: block;
        padding: 0;
    }

    .dropdown-column {
        padding: 10px 20px;
        border-bottom: 1px solid #d2d2d7;
    }

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

    .submenu {
        position: static;
        display: none;
        background: rgba(245, 245, 247, 0.95);
    }

    .submenu.show {
        display: block;
    }

    .submenu-arrow.rotated {
        transform: rotate(90deg);
    }
}