/* 平板横向布局优化 */

/* 平板横屏 (768px-1023px, 横向) */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
    /* 使用桌面端布局 */
    body.tablet-landscape .navbar-left {
        display: flex !important;
    }

    body.tablet-landscape .navbar-center {
        display: none !important;
    }

    body.tablet-landscape .navbar-right {
        display: flex !important;
    }

    body.tablet-landscape .ombox-mobile-breadcrumb {
        display: none !important;
    }

    body.tablet-landscape .ombox-mobile-bottom-nav {
        display: none !important;
    }

    body.tablet-landscape .ombox-page-footer {
        display: block !important;
    }

    /* Sidebar 宽度优化（平板横屏空间更充裕） */
    body.tablet-landscape .ombox-sidebar {
        width: 240px;
    }

    body.tablet-landscape .ombox-sidebar.collapsed {
        width: 64px;
    }

    /* 内容区调整 */
    body.tablet-landscape .content {
        margin-left: 240px;
    }

    body.tablet-landscape .ombox-sidebar.collapsed ~ .content,
    body.tablet-landscape .content.sidebar-collapsed {
        margin-left: 64px;
    }
}

/* 平板竖屏 (768px-1023px, 竖向) - 使用桌面端布局 */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
    /* 也使用桌面端布局，因为宽度 >=768px */
    body.tablet-portrait .navbar-left {
        display: flex !important;
    }

    body.tablet-portrait .navbar-center {
        display: none !important;
    }

    body.tablet-portrait .navbar-right {
        display: flex !important;
    }

    body.tablet-portrait .ombox-mobile-breadcrumb {
        display: none !important;
    }

    body.tablet-portrait .ombox-mobile-bottom-nav {
        display: none !important;
    }

    body.tablet-portrait .ombox-page-footer {
        display: block !important;
    }
}

/*
 * 手机端强制规则：确保在 <768px 时，即使有 tablet 类也不生效
 * 修复 Chrome DevTools 缩放导致的设备检测误判
 *
 * 使用最高优先级的选择器确保规则生效
 */
@media (max-width: 767.98px) {
    /* 强制隐藏 footer - 多重选择器确保优先级 */
    body.ombox-shell .ombox-page-footer,
    body.program-shell-layout .ombox-page-footer,
    body.device-mobile .ombox-page-footer,
    body.device-tablet .ombox-page-footer,
    body.tablet-landscape .ombox-page-footer,
    body.tablet-portrait .ombox-page-footer,
    body .ombox-page-footer {
        display: none !important;
        visibility: hidden !important;
    }

    /* 强制显示移动端面包屑 */
    body.ombox-shell .ombox-mobile-breadcrumb,
    body .ombox-mobile-breadcrumb {
        display: block !important;
        visibility: visible !important;
    }

    /* 强制隐藏桌面端面包屑容器 */
    body.ombox-shell .navbar-left,
    body .navbar-left {
        display: none !important;
        visibility: hidden !important;
    }

    /* 强制显示移动端底部导航 */
    body.ombox-shell .ombox-mobile-bottom-nav,
    body.has-mobile-bottom-nav .ombox-mobile-bottom-nav,
    body .ombox-mobile-bottom-nav {
        display: block !important;
        visibility: visible !important;
    }
}

/* device-mobile 只增强手机/手机横屏宽度，避免设备类误判污染 PC。 */
@media (max-width: 1023.98px) {
    body.device-mobile .ombox-page-footer {
        display: none !important;
        visibility: hidden !important;
    }

    body.device-mobile .ombox-mobile-bottom-nav {
        display: block !important;
        visibility: visible !important;
    }

    body.device-mobile .navbar-left {
        display: none !important;
        visibility: hidden !important;
    }

    body.device-mobile .ombox-mobile-breadcrumb {
        display: block !important;
        visibility: visible !important;
    }

    /* 手机横屏特殊处理 - 使用 body class */
    body.device-mobile.orientation-landscape nav.navbar,
    body.device-mobile.orientation-landscape nav.navbar-fixed {
        height: 48px !important;
    }

    body.device-mobile.orientation-landscape .navbar-container {
        height: 48px !important;
    }

    body.device-mobile.orientation-landscape .navbar-center-logo img {
        height: 28px !important;
    }

    body.device-mobile.orientation-landscape .content {
        margin-top: 48px !important;
    }

    body.device-mobile.orientation-landscape .ombox-mobile-bottom-nav {
        height: 52px !important;
    }

    body.device-mobile.orientation-landscape .ombox-mobile-bottom-nav-container {
        height: 52px !important;
    }

    body.device-mobile.orientation-landscape .ombox-mobile-nav-item i {
        font-size: 18px !important;
    }

    body.device-mobile.orientation-landscape .ombox-mobile-nav-create i {
        font-size: 24px !important;
    }

    body.device-mobile.orientation-landscape .ombox-mobile-nav-label {
        font-size: 10px !important;
    }
}
