/* ===========================================
   Neo Top Navigation Menu Styles
   版本: 2.0.0 - 设备响应式优化
   文件位置: /css/neo_menu_topnav.css
   描述: 支持PC/平板/手机的响应式导航菜单样式
   =========================================== */

/* ===== 基础样式 ===== */

/* 头部导航 - Microsoft 风格 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    position: relative;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 0;
}

.logo {
    height: 66px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.logo img {
    height: 100%;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-menu a {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-primary);
    padding: 8px 16px;
    transition: all 0.2s ease;
    position: relative;
    border-radius: 2px;
}

.nav-menu a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-menu a.active {
    color: var(--primary-blue);
    background: transparent;
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--primary-blue);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.qrcode-btn {
    width: 32px;
    height: 32px;
    border-radius: 2px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    color: var(--text-primary);
    margin-left: -10px;
}

.qrcode-btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-secondary);
}

.qrcode-btn:hover .qrcode-popup,
.qrcode-btn.active .qrcode-popup {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInDown 0.3s ease-out;
}

.qrcode-popup {
    /* 移除默认的 display: none，完全由JavaScript控制 */
    position: absolute;
    top: 100%;
    right: 0;
    width: 260px;
    height: 300px;
    background: linear-gradient(136deg, rgba(102, 126, 234, 0.9) 0%, rgba(64, 158, 255, 0.95) 100%);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    z-index: 1001;
    text-align: center;
    padding-top: 30px;
    backdrop-filter: blur(10px);
    margin-top: 8px;
}


/* 移除hover样式，所有设备都使用点击事件 */

.qrcode-btn.active .qrcode-popup {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInDown 0.3s ease-out;
}

.qrcode-popup-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    line-height: 24px;
}

.qrcode-popup-img {
    width: 180px;
    height: 180px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Crect fill='%23fff' opacity='0.2' width='180' height='180' rx='8'/%3E%3C/svg%3E") no-repeat center;
    background-size: 100% 100%;
    padding: 16px;
    box-sizing: border-box;
    margin: 0 auto;
}

.qrcode-popup-img img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.qrcode-popup-subtitle {
    font-size: 16px;
    color: #fff;
    margin-top: 16px;
    line-height: 20px;
    font-weight: 400;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: #333;
    transition: all 0.3s;
}

/* ===========================================
   响应式设计
   =========================================== */

/* 平板样式 */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0 16px;
    }

    .nav-menu {
        gap: 4px;
    }

    .nav-menu a {
        padding: 8px 12px;
        font-size: 15px;
    }

    .nav-right {
        gap: 10px;
    }

    .qrcode-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .qrcode-popup {
        width: 240px;
        height: 280px;
        padding-top: 25px;
        /* 平板保持默认居中定位 */
    }


    .qrcode-popup-title {
        font-size: 14px;
    }

    .qrcode-popup-img {
        width: 160px;
        height: 160px;
        padding: 14px;
    }

    .qrcode-popup-subtitle {
        font-size: 14px;
        margin-top: 12px;
    }
}

/* ===== 设备特定样式重构 ===== */

/* PC设备样式 (默认) */
@media (min-width: 1025px) {
    /* PC端二维码弹窗样式 */
    .qrcode-popup {
        position: absolute;
        top: 100%;
        right: 0;
        width: 260px;
        height: 300px;
        margin-top: 8px;
    }

    /* 弹窗显示完全由JavaScript控制，不再依赖CSS的active类 */
}

/* 平板设备样式 */
@media (min-width: 769px) and (max-width: 1024px) {
    /* 平板端导航容器调整 */
    .nav-container {
        padding: 0 3%;
    }

    /* 平板端二维码弹窗样式 */
    .qrcode-popup {
        width: 200px;
        height: 240px;
        padding-top: 20px;
    }

    .qrcode-popup-title {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .qrcode-popup-img {
        width: 140px;
        height: 140px;
        padding: 12px;
    }

    .qrcode-popup-subtitle {
        font-size: 13px;
        margin-top: 10px;
    }
}

/* 手机设备样式 */
@media (max-width: 768px) {
    /* 手机端导航容器调整 */
    .nav-container {
        height: 60px;
        padding: 0 4%;
    }

    .nav-left {
        gap: 16px;
    }

    .logo {
        height: 56px;
        font-size: 14px;
    }

    /* 手机端菜单按钮 */
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        width: 24px;
        height: 24px;
        cursor: pointer;
        gap: 4px;
    }

    .mobile-menu-btn span {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--text-primary);
        transition: all 0.3s ease;
        transform-origin: center;
    }

    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    /* 手机端二维码弹窗样式 */
    .qrcode-popup {
        width: 180px;
        height: 220px;
        padding-top: 15px;
        /* 居中定位，由JavaScript控制 */
    }

    .qrcode-popup-title {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .qrcode-popup-img {
        width: 120px;
        height: 120px;
        padding: 8px;
    }

    .qrcode-popup-subtitle {
        font-size: 11px;
        margin-top: 8px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .nav-container {
        height: 56px;
        padding: 0 3%;
    }

    .logo {
        height: 48px;
        font-size: 12px;
    }

    .qrcode-popup {
        width: 160px;
        height: 200px;
        padding-top: 12px;
    }

    .qrcode-popup-title {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .qrcode-popup-img {
        width: 110px;
        height: 110px;
        padding: 6px;
    }

    .qrcode-popup-subtitle {
        font-size: 10px;
        margin-top: 6px;
    }
}
}