/* 共享导航栏 - 按 MasterGo 设计稿还原 */
.shared-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 220px;
    height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--tw-slate-200);
    display: flex;
    flex-direction: column;
    padding: 24px 12px 12px;
    z-index: 1000;
    box-sizing: border-box;
}

/* 主内容区域偏移 - 桌面端默认 */
.page-content {
    margin-left: 220px;
    min-height: 100vh;
    padding: 40px;
    background: var(--tw-slate-50);
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-sizing: border-box;
}

/* 移动端顶部栏（桌面端隐藏） */
.nav-mobile-header {
    display: none;
}

.nav-menu-btn {
    display: none;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}

.nav-menu-btn:hover {
    background: var(--tw-slate-100);
}

.nav-menu-icon {
    width: 28px;
    height: 28px;
    display: block;
}

/* 导航列表 */
.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

/* 导航项 */
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border-radius: 8px;
    color: var(--tw-slate-500);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    transition: background-color 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
    box-sizing: border-box;
}

.nav-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--tw-slate-800);
}

/* 选中态 */
.nav-item.active {
    background: var(--tw-blue-50);
    color: var(--tw-blue-700);
    font-weight: 700;
    border-radius: 12px;
    box-shadow: none;
}

.nav-item.active .nav-icon-img {
    filter: brightness(0) saturate(100%) invert(23%) sepia(91%) saturate(2357%) hue-rotate(217deg) brightness(96%) contrast(93%);
}

/* 导航图标 */
.nav-icon-img {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    object-fit: contain;
}

.nav-label {
    white-space: nowrap;
    line-height: 1;
}

/* 分割线 */
.nav-divider {
    height: 1px;
    background: var(--tw-slate-200);
    width: 100%;
    flex-shrink: 0;
    margin: 12px 0;
}

/* ===== 平板端收起模式 (768px - 1023px) ===== */
@media (max-width: 1023px) {
    .shared-nav {
        width: 96px;
        padding: 24px 12px 12px;
        align-items: center;
    }

    .nav-logo-desktop {
        justify-content: center;
        margin-bottom: 24px;
        width: 100%;
        padding: 0;
    }

    .nav-logo-desktop .logo-img {
        width: 32px;
        height: 32px;
    }

    .nav-logo-desktop .nav-logo-brand {
        display: none !important;
    }

    .nav-list {
        width: 100%;
        align-items: center;
        gap: 8px;
    }

    .nav-item {
        width: 48px;
        height: 48px;
        padding: 0;
        justify-content: center;
        border-radius: 8px;
    }

    .nav-label {
        display: none;
    }

    .nav-icon-img {
        width: 16px;
        height: 16px;
    }

    .nav-divider {
        width: 100%;
        margin: 16px 0;
    }

    .page-content {
        margin-left: 96px;
        padding: 24px;
    }
}

/* ===== 手机端顶部导航 (< 768px) ===== */
@media (max-width: 767px) {
    .shared-nav {
        width: 100%;
        height: auto;
        max-height: 56px;
        left: 0;
        top: 0;
        flex-direction: column;
        padding: 0;
        border-right: none;
        border-bottom: 1px solid var(--tw-slate-200);
        background: var(--white);
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .shared-nav.open {
        max-height: 100vh;
    }

    .shared-nav:not(.open) .nav-list,
    .shared-nav:not(.open) .nav-divider,
    .shared-nav:not(.open) .nav-logo-desktop {
        display: none;
    }

    .nav-logo-desktop,
    .shared-nav.open .nav-logo-desktop {
        display: none !important;
    }

    .nav-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        height: 56px;
        padding: 0 16px;
        flex-shrink: 0;
        box-sizing: border-box;
    }

    .nav-mobile-header .nav-logo {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 0;
        padding: 0;
    }

    .nav-mobile-header .logo-img {
        width: 28px;
        height: 28px;
    }

    .nav-mobile-header .nav-logo-text {
        font-size: 16px;
        line-height: 22px;
        font-weight: 700;
        color: var(--tw-slate-800);
        white-space: nowrap;
    }

    .nav-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-list {
        padding: 8px 12px;
        gap: 8px;
        width: 100%;
        flex: none;
        margin: 0;
        align-items: stretch;
    }

    .nav-list li {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .nav-item {
        width: 100%;
        height: 48px;
        padding: 0 16px;
        justify-content: flex-start;
        border-radius: 8px;
        margin: 0;
    }

    .nav-item.active {
        border-radius: 8px;
    }

    .nav-label {
        display: block;
        font-size: 15px;
    }

    .nav-list + .nav-list {
        padding-top: 0;
    }

    .nav-divider {
        margin: 4px 0;
        width: 100%;
    }

    .page-content {
        margin-left: 0;
        padding: 100px 12px 16px;
    }
}

/* 桌面端 Logo */
.nav-logo-desktop {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-shrink: 0;
    padding: 0 12px;
}

.nav-logo-desktop .logo-img {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    object-fit: contain;
}

.nav-logo-desktop .nav-logo-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2px;
}

.nav-logo-desktop .nav-logo-sub {
    font-size: 10px;
    font-weight: 500;
    color: var(--tw-slate-400);
    line-height: 12px;
    white-space: nowrap;
}

.nav-logo-desktop .nav-logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--tw-slate-800);
    white-space: nowrap;
    line-height: 24px;
}
