/**
 * Shell Layout CSS
 * 统一的页面 Shell 布局样式
 * Version: 1.0.16
 */

/* ==================== Shell 基础布局 ==================== */

html {
    overflow-y: auto;
    scrollbar-gutter: stable;
}

/*
 * 桌面 Program Shell 使用内容区作为唯一滚动容器，不需要 html 再预留滚动条槽。
 * 取消根槽可让固定 Navbar 贯通至视口右缘；实际内容滚动条继续保留稳定槽，
 * 并让轨道跟随 Navbar/护眼模式的表面色，滑块保持清晰可见。
 */
@media (min-width: 768px) {
    html:has(body.program-shell-layout) {
        scrollbar-gutter: auto;
    }

    body.program-shell-layout > .container > .content,
    body.program-shell-layout > .container > .ombox-page-content {
        scrollbar-color: var(--border-color, #dfe3e8) var(--bg-white, #ffffff);
    }

    body.program-shell-layout > .container > .content::-webkit-scrollbar-track,
    body.program-shell-layout > .container > .ombox-page-content::-webkit-scrollbar-track {
        background: var(--bg-white, #ffffff);
    }

    body.program-shell-layout > .container > .content::-webkit-scrollbar-thumb,
    body.program-shell-layout > .container > .ombox-page-content::-webkit-scrollbar-thumb {
        background: var(--border-color, #dfe3e8);
        border: 3px solid var(--bg-white, #ffffff);
        border-radius: 999px;
    }

    body.program-shell-layout > .container > .content::-webkit-scrollbar-thumb:hover,
    body.program-shell-layout > .container > .ombox-page-content::-webkit-scrollbar-thumb:hover {
        background: var(--text-secondary, #667085);
    }
}

body.has-sidebar {
    margin-left: var(--sidebar-width, 240px);
}

body.has-topbar {
    padding-top: 56px;
}

.shell-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.ombox-shell .shell-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.ombox-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width, 240px);
    height: 100vh;
    background: var(--bg-white, #ffffff);
    color: var(--text-primary, #2d3748);
    display: flex;
    flex-direction: column;
    z-index: var(--z-sidebar);
    border-right: 1px solid var(--border-color, #e2e8f0);
    box-shadow: 8px 0 28px rgba(15, 23, 42, 0.04);
    transition: width 0.3s ease, transform 0.3s ease;
}

.ombox-page-content {
    flex: 1;
    min-height: 0;
    background: var(--color-gray-50);
}

.ombox-global-watermark {
    position: fixed;
    inset: 56px 0 48px var(--sidebar-width, 240px);
    /* Above page content, below navbar/sidebar/dropdowns/modals. */
    z-index: calc(var(--z-navbar, 1000) - 1);
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    grid-auto-rows: 160px;
    align-items: center;
    justify-items: center;
    pointer-events: none;
    overflow: hidden;
    user-select: none;
}

.ombox-global-watermark span {
    color: rgba(15, 23, 42, 0.08);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
    transform: rotate(-24deg);
}

body.eye-protection .ombox-global-watermark span,
body.eye-protection-sepia .ombox-global-watermark span {
    color: rgba(74, 60, 40, 0.1);
}

body.sidebar-collapsed .ombox-global-watermark {
    left: var(--sidebar-collapsed-width, 72px);
}

@media (max-width: 767.98px) {
    .ombox-global-watermark {
        inset: 56px 0 var(--mobile-bottom-nav-height, 64px) 0;
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        grid-auto-rows: 140px;
    }

    .ombox-global-watermark span {
        font-size: 20px;
    }
}

@media print {
    .ombox-global-watermark {
        display: none;
    }
}

.ombox-page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3, 12px);
    flex-wrap: wrap;
    position: static;
    z-index: auto;
    width: 100%;
    min-height: var(--navbar-height, 56px);
    margin: 0;
    padding: 0 var(--space-4, 16px);
    background: var(--bg-white, #ffffff);
    border-bottom: var(--border-width-thin, 1px) solid var(--border-color, #e2e8f0);
    box-shadow: none;
}

.ombox-page-toolbar .ombox-toolbar-left,
.ombox-page-toolbar .ombox-toolbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
    flex-wrap: wrap;
    min-width: 0;
}

.ombox-page-toolbar .ombox-toolbar-right {
    justify-content: flex-end;
    margin-left: auto;
}

.ombox-page-footer {
    width: 100%;
    margin-left: 0;
}

/* Footer owns a permanent shell row; the content row scrolls independently. */
body.ombox-shell .ombox-page-footer {
    position: static;
    inset: auto;
    flex-shrink: 0;
    margin-top: auto;
}

/* Shell 容器 - 确保不产生额外滚动条 */
body:not(.ombox-shell) > .container {
    overflow: visible;
}

/* .shell-main - LEGACY duplicate removed */

/* ========================================
   Sidebar 样式
   ======================================== */

.ombox-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width, 240px);
    height: 100vh;
    background: var(--bg-white, #ffffff);
    color: var(--text-primary, #2d3748);
    display: flex;
    flex-direction: column;
    z-index: var(--z-sidebar);
    border-right: 1px solid var(--border-color, #e2e8f0);
    box-shadow: 8px 0 28px rgba(15, 23, 42, 0.04);
    transition: width 0.3s ease, transform 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--navbar-height, 56px);
    padding: 10px 18px;
    border-bottom: var(--border-width-thin) solid var(--border-color, #e2e8f0);
    background: var(--bg-white, #ffffff);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 100%;
    max-width: var(--sidebar-logo-width, 184px);
    height: 40px;
    border-radius: var(--radius-md, 8px);
    color: var(--text-primary, #2d3748);
    text-decoration: none;
    font-size: var(--font-size-h3);
    font-weight: 600;
    overflow: hidden;
    transition: var(--transition-fast);
}

.sidebar-brand-logo {
    display: block;
    width: var(--sidebar-logo-width, 184px);
    max-width: 100%;
    height: var(--sidebar-logo-height, 36px);
    object-fit: contain;
}

.sidebar-brand-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
    line-height: 1.1;
}

.brand-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-brand i {
    font-size: var(--font-size-xl);
    color: var(--color-primary);
}

.sidebar-brand:hover {
    background: var(--bg-gray, #f7fafc);
    color: var(--primary-color, #0087f7);
}

.ombox-sidebar.collapsed,
body.sidebar-collapsed .ombox-sidebar {
    width: var(--sidebar-collapsed-width, 64px);
    transform: none;
}

.ombox-sidebar.collapsed .sidebar-brand,
.ombox-sidebar.collapsed .sidebar-brand-copy,
.ombox-sidebar.collapsed .sidebar-empty-state,
.ombox-sidebar.collapsed .menu-text,
.ombox-sidebar.collapsed .menu-arrow,
.ombox-sidebar.collapsed .status-text,
body.sidebar-collapsed .ombox-sidebar .sidebar-brand,
body.sidebar-collapsed .ombox-sidebar .sidebar-brand-copy,
body.sidebar-collapsed .ombox-sidebar .sidebar-empty-state,
body.sidebar-collapsed .ombox-sidebar .menu-text,
body.sidebar-collapsed .ombox-sidebar .menu-arrow,
body.sidebar-collapsed .ombox-sidebar .status-text {
    display: none !important;
}

.ombox-sidebar.collapsed .sidebar-header,
body.sidebar-collapsed .ombox-sidebar .sidebar-header {
    justify-content: center;
    padding: 12px 8px;
}

.ombox-sidebar.collapsed .sidebar-collapsed-toggle,
body.sidebar-collapsed .ombox-sidebar .sidebar-collapsed-toggle {
    display: inline-flex !important;
}

.sidebar-collapsed-toggle {
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    cursor: pointer;
    border-radius: var(--radius-md, 8px);
    appearance: none;
    -webkit-appearance: none;
}

.sidebar-collapsed-toggle:hover,
.sidebar-collapsed-toggle:focus-visible {
    background: var(--bg-gray, #f7fafc);
    outline: none;
}

.sidebar-collapsed-logo {
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.ombox-sidebar.collapsed .menu-link,
.ombox-sidebar.collapsed .submenu-link,
body.sidebar-collapsed .ombox-sidebar .menu-link,
body.sidebar-collapsed .ombox-sidebar .submenu-link {
    justify-content: center;
    padding-right: 8px;
    padding-left: 8px;
    margin-right: 8px;
    margin-left: 8px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0 12px;
    list-style: none;
    margin: 0;
}

body.ombox-dynamic-page .sidebar-menu {
    padding: 8px 0 !important;
}

.menu-item {
    margin-bottom: 4px;
}

.menu-divider,
.submenu-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 12px 8px;
    color: var(--text-muted, #8a94a6);
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.04em;
}

.menu-divider::before,
.menu-divider::after,
.submenu-divider::before,
.submenu-divider::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: var(--border-color, #e2e8f0);
}

.ombox-sidebar.collapsed .menu-divider span,
.ombox-sidebar.collapsed .submenu-divider span,
body.sidebar-collapsed .ombox-sidebar .menu-divider span,
body.sidebar-collapsed .ombox-sidebar .submenu-divider span {
    display: none;
}

body.eye-protection .menu-divider,
body.eye-protection .submenu-divider {
    color: var(--text-muted, #7c897b);
}

body.eye-protection .menu-divider::before,
body.eye-protection .menu-divider::after,
body.eye-protection .submenu-divider::before,
body.eye-protection .submenu-divider::after {
    background: var(--border-color, #d7ddcf);
}

body.ombox-dynamic-page .menu-item {
    margin-bottom: 4px !important;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: auto;
    padding: 12px 20px;
    color: var(--sidebar-link-color, #2f3a4a);
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
    border-radius: var(--radius-md, 8px);
    margin: 2px 8px;
    outline: none;
}

body.ombox-dynamic-page .menu-link {
    border-radius: var(--radius-md, 8px) !important;
    margin: 2px 8px !important;
}

.menu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    border-radius: 0 3px 3px 0;
    background: var(--primary-color, #0087f7);
    transition: height 0.2s ease;
}

.menu-link:hover {
    background: rgba(0, 135, 247, 0.08);
    color: var(--text-primary, #2d3748);
}

.menu-item.active > .menu-link {
    background: rgba(0, 135, 247, 0.15);
    color: var(--primary-color, #0087f7);
    font-weight: 500;
}

.menu-link:hover::before {
    height: 60%;
}

.menu-item.active > .menu-link::before {
    height: 80%;
}

.menu-link i {
    flex: 0 0 20px;
    width: 20px;
    text-align: center;
    font-size: var(--icon-size-base);
}

.menu-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-arrow {
    margin-left: auto;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    opacity: 0.55;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    flex: 0 0 auto;
}

.menu-item.has-active-child > .menu-link .menu-arrow,
.menu-item.open > .menu-link .menu-arrow,
.submenu-item.has-active-child > .submenu-link .menu-arrow,
.submenu-item.open > .submenu-link .menu-arrow {
    transform: rotate(225deg);
}

/* 子菜单 */
.submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.submenu.show {
    max-height: 600px;
}

.submenu-item {
    margin: 0;
    position: relative;
}

.submenu-item::before {
    content: none;
}

.submenu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 10px 40px;
    color: var(--sidebar-submenu-link-color, #3f4b5f);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: var(--transition-fast);
    border-radius: var(--radius-md, 8px);
    margin: 2px 8px;
    position: relative;
}

.submenu-link::before {
    content: none;
}

.submenu-link .submenu-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.submenu-link:hover {
    background: rgba(0, 135, 247, 0.06);
    color: var(--text-primary, #4a5568);
}

.submenu-item.active > .submenu-link {
    background: rgba(0, 135, 247, 0.12);
    color: var(--primary-color, #0087f7);
    font-weight: 500;
    border-left: 3px solid var(--primary-color, #0087f7);
    padding-left: 37px;
}

.submenu-link i {
    flex: 0 0 16px;
    width: 16px;
    text-align: center;
    font-size: var(--icon-size-sm);
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 12px 16px;
    border-top: var(--border-width-thin) solid var(--border-color, #e2e8f0);
    background: var(--bg-white, #ffffff);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-secondary, #718096);
    font-size: var(--font-size-sm);
}

.user-info i {
    font-size: var(--font-size-xl);
}

/* 滚动条样式 */
.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(113, 128, 150, 0.22);
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(113, 128, 150, 0.34);
}

.sidebar-empty-state {
    list-style: none;
    margin: 8px;
    padding: 14px;
    border: 1px dashed var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 8px);
    background: var(--bg-gray, #f7fafc);
    color: var(--text-secondary, #718096);
}

.sidebar-empty-state strong,
.sidebar-empty-state small,
.sidebar-empty-kicker {
    display: block;
}

.sidebar-empty-state strong {
    margin-top: 4px;
    color: var(--text-primary, #2d3748);
    font-size: var(--font-size-sm);
}

.sidebar-empty-state small {
    margin-top: 4px;
    line-height: 1.45;
}

.sidebar-empty-kicker {
    color: var(--primary-color, #0087f7);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

body.eye-protection .ombox-sidebar,
body.eye-protection .sidebar-header,
body.eye-protection .sidebar-footer,
body.eye-protection-sepia .ombox-sidebar,
body.eye-protection-sepia .sidebar-header,
body.eye-protection-sepia .sidebar-footer {
    background: var(--bg-white, #f7fcf8);
    border-color: var(--border-color, #cfe3d2);
}

body.eye-protection .menu-link:hover,
body.eye-protection .submenu-link:hover,
body.eye-protection-sepia .menu-link:hover,
body.eye-protection-sepia .submenu-link:hover {
    background: var(--bg-gray, #edf7ee);
}

body.eye-protection .menu-item.active > .menu-link,
body.eye-protection .submenu-item.active > .submenu-link,
body.eye-protection-sepia .menu-item.active > .menu-link,
body.eye-protection-sepia .submenu-item.active > .submenu-link {
    background: color-mix(in srgb, var(--primary-color, #4f9d69) 14%, transparent);
    color: var(--primary-color, #4f9d69);
}

/* ========================================
   Sidebar 遮罩层（移动端）
   ======================================== */

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-overlay);
    z-index: calc(var(--z-sidebar) - 1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 移动端汉堡按钮：桌面隐藏，移动端显示（开/关 off-canvas 抽屉） */
.navbar-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-text-primary, #212529);
    font-size: 18px;
    cursor: pointer;
    border-radius: var(--radius-base, 6px);
}
.navbar-mobile-toggle:hover {
    background: var(--bg-gray, #f7fafc);
}

/* ========================================
   Topbar 样式 - LEGACY (未在 markup 中使用)
   ======================================== */
/*
.shell-topbar {
    position: fixed;
    top: 0;
    left: 242px;
    right: 0;
    height: 56px;
    background: var(--color-white);
    border-bottom: var(--border-width-thin) solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-4);
    z-index: var(--z-navbar);
    transition: left 0.3s ease;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.sidebar-toggle {
    display: none;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-base);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--color-gray-50);
    color: var(--color-text-primary);
}

.topbar-title {
    font-size: var(--font-size-h3);
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.topbar-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-base);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.topbar-btn:hover {
    background: var(--color-gray-50);
    color: var(--color-text-primary);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.topbar-user:hover {
    background: var(--color-gray-50);
}

.topbar-user i {
    font-size: var(--font-size-xl);
    color: var(--color-text-secondary);
}

.topbar-user span {
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
}
*/

/* ========================================
   Footer 样式
   ======================================== */

/* Legacy - consolidated into .ombox-page-footer
.shell-footer {
    background: var(--color-white);
    border-top: var(--border-width-thin) solid var(--color-border);
    padding: var(--space-4);
    text-align: center;
}
*/

.footer-content {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.footer-content p {
    margin: 0;
}

/* ========================================
   Status Bar 样式
   ======================================== */

.shell-statusbar {
    position: fixed;
    bottom: 0;
    left: 242px;
    right: 0;
    height: 24px;
    background: var(--color-gray-100);
    border-top: var(--border-width-thin) solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-3);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    z-index: var(--z-sticky);
    transition: left 0.3s ease;
}

.statusbar-left,
.statusbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.status-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

body.ombox-dynamic-page .ombox-dynamic-mobile-tabbar {
    display: none;
}

/* ========================================
   响应式布局
   ======================================== */

@media (max-width: 767.98px) {
    .ombox-sidebar,
    .ombox-sidebar.collapsed,
    body.sidebar-collapsed .ombox-sidebar {
        width: var(--sidebar-width, 240px);
    }

    .ombox-sidebar.collapsed .sidebar-brand,
    body.sidebar-collapsed .ombox-sidebar .sidebar-brand {
        display: flex !important;
    }

    .ombox-sidebar.collapsed .menu-text,
    .ombox-sidebar.collapsed .submenu-text,
    .ombox-sidebar.collapsed .menu-arrow,
    body.sidebar-collapsed .ombox-sidebar .menu-text,
    body.sidebar-collapsed .ombox-sidebar .submenu-text,
    body.sidebar-collapsed .ombox-sidebar .menu-arrow {
        display: inline-flex !important;
    }

    .ombox-sidebar.collapsed .sidebar-collapsed-toggle,
    body.sidebar-collapsed .ombox-sidebar .sidebar-collapsed-toggle {
        display: none !important;
    }

    /* 移动端：body 不留边距 */
    body.has-sidebar {
        margin-left: 0;
    }

    /* 移动端：内容区下移，避开固定顶部 navbar，但不留额外间距 */
    body.program-shell-layout > .container,
    body.ombox-shell > .container {
        padding-top: 0;
        margin-top: var(--navbar-height, 56px);
    }

    /* 移动端：显示汉堡按钮 */
    .navbar-mobile-toggle {
        display: inline-flex;
    }

    /* 移动端：Sidebar 默认隐藏 */
    .ombox-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .ombox-sidebar.show {
        transform: translateX(0);
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
    }

    /* 移动端：确保 sidebar 内容可见性 */
    .ombox-sidebar.show .sidebar-menu {
        display: flex;
        flex-direction: column;
    }

    .ombox-sidebar.show .menu-link,
    .ombox-sidebar.show .submenu-link {
        min-height: 48px; /* 触摸友好 */
        display: flex;
        align-items: center;
    }

    /* 移动端：显示切换按钮 */
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 移动端：Topbar 占满宽度 */
    /* LEGACY - shell-topbar removed
    .shell-topbar {
        left: 0;
    }
    */

    /* 移动端：Status Bar 占满宽度 */
    .shell-statusbar {
        left: 0;
    }

    /* 移动端：隐藏 footer（使用底部导航栏替代） */
    .ombox-page-footer {
        display: none !important;
    }

    body.ombox-dynamic-page .ombox-dynamic-mobile-tabbar {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1040;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
        padding: 7px 12px calc(7px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--color-border, #e2e8f0);
        border-bottom: 1px solid var(--color-border, #e2e8f0);
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    body.ombox-dynamic-page .ombox-dynamic-mobile-tabbar-item {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-width: 0;
        min-height: 44px;
        padding: 4px 2px;
        border-radius: 0;
        color: var(--text-secondary, #64748b);
        font-size: 11px;
        line-height: 1.1;
        text-decoration: none;
    }

    body.ombox-dynamic-page .ombox-dynamic-mobile-tabbar-item i {
        font-size: 15px;
        line-height: 1;
    }

    body.ombox-dynamic-page .ombox-dynamic-mobile-tabbar-item + .ombox-dynamic-mobile-tabbar-item {
        border-left: 1px solid rgba(226, 232, 240, .82);
    }

    body.ombox-dynamic-page .ombox-dynamic-mobile-tabbar-item span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.ombox-dynamic-page .ombox-dynamic-mobile-tabbar-item:active,
    body.ombox-dynamic-page .ombox-dynamic-mobile-tabbar-item.is-active {
        background: #eef7ff;
        color: #0087f7;
    }

    body.eye-protection.ombox-dynamic-page .ombox-dynamic-mobile-tabbar {
        background: transparent;
        border-color: var(--border-color, #cfe3d2);
        box-shadow: none;
    }

    body.eye-protection.ombox-dynamic-page .ombox-dynamic-mobile-tabbar-item {
        color: var(--text-secondary, #52695a);
    }

    body.eye-protection.ombox-dynamic-page .ombox-dynamic-mobile-tabbar-item + .ombox-dynamic-mobile-tabbar-item {
        border-left-color: var(--border-color, #cfe3d2);
    }

    body.eye-protection.ombox-dynamic-page .ombox-dynamic-mobile-tabbar-item:active,
    body.eye-protection.ombox-dynamic-page .ombox-dynamic-mobile-tabbar-item.is-active {
        background: var(--bg-gray, #edf7ee);
        color: var(--primary-color, #4f9d69);
    }

    /* LEGACY - topbar-user removed
    .topbar-user span {
        display: none;
    }
    */
}

/* ========================================
   无障碍支持
   ======================================== */

/* 焦点可见性 */
.sidebar-toggle:focus-visible,
.menu-link:focus-visible,
.submenu-link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    .ombox-sidebar,
    .sidebar-overlay,
    .shell-statusbar,
    .menu-link,
    .submenu,
    .sidebar-toggle {
        transition: none;
    }
}

/* ========================================
   打印样式
   ======================================== */

@media print {
    .ombox-sidebar,
    .sidebar-overlay,
    .ombox-page-footer,
    .shell-statusbar {
        display: none;
    }

    body.has-sidebar {
        margin-left: 0;
    }

    body.has-topbar {
        padding-top: 0;
    }

    /* LEGACY - shell-main removed
    .shell-main {
        background: white;
    }
    */
}

/* ========================================
   防止背景滚动（Sidebar 打开时）
   ======================================== */

body.sidebar-open {
    overflow: hidden;
}

/* ========================================
   Sidebar 折叠位移 / 用户触发条 / 用户面板
   （从 OMBoxOS/Views/includes/sidebar.php 内联 <style> 抽取）
   ======================================== */

body.has-sidebar.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width, 64px);
}

body.has-sidebar.sidebar-collapsed .shell-statusbar {
    left: var(--sidebar-collapsed-width, 64px);
}

body.sidebar-collapsed .footer-container {
    margin-left: var(--sidebar-collapsed-width, 64px);
}

/* ── sidebar footer / user trigger ── */
.ombox-sidebar .sidebar-footer {
    position: relative;
    flex-shrink: 0;
    border-top: 1px solid var(--sidebar-border, rgba(255,255,255,.08));
    /* 固定为页脚高度，使其上边框线与 .ombox-page-footer 在同一水平线上 */
    height: var(--footer-height, 48px);
    min-height: var(--footer-height, 48px);
    padding: 0;
    overflow: hidden;
}

.sidebar-user-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    cursor: pointer;
    transition: background .15s;
    user-select: none;
    height: 100%;
}
.sidebar-user-trigger:hover {
    background: rgba(0, 135, 247, .08);
    color: #0087f7;
}

.sidebar-user-avatar { display: none; }

.ombox-sidebar.collapsed .sidebar-footer {
    display: block !important;
}

.ombox-sidebar.collapsed .sidebar-user-trigger {
    justify-content: center;
    padding: 0;
}

.ombox-sidebar.collapsed .sidebar-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--text-secondary, #4a5568);
}

.ombox-sidebar.collapsed .sidebar-user-trigger:hover .sidebar-user-avatar {
    background: rgba(0, 135, 247, .08);
    color: #0087f7;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.sidebar-user-name {
    display: -webkit-box;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.sidebar-user-role {
    font-size: 11px;
    opacity: .6;
    white-space: normal;
    word-break: break-word;
}
.sidebar-user-verification {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    margin-top: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.35;
    text-decoration: none;
    border: 1px solid transparent;
    white-space: nowrap;
    cursor: pointer;
}
.sidebar-user-verification:hover {
    text-decoration: none;
}
.sidebar-user-verification:focus-visible {
    outline: 2px solid rgba(0, 135, 247, .45);
    outline-offset: 2px;
}
.sidebar-user-verification i {
    font-size: 10px;
}
.sidebar-user-verification--success {
    color: #0f8a45;
    background: rgba(15, 138, 69, .1);
    border-color: rgba(15, 138, 69, .22);
}
.sidebar-user-verification--warning {
    color: #9a6700;
    background: rgba(245, 158, 11, .13);
    border-color: rgba(245, 158, 11, .26);
}
.sidebar-user-verification--danger {
    color: #b42318;
    background: rgba(220, 38, 38, .1);
    border-color: rgba(220, 38, 38, .22);
}
.sidebar-user-verification--muted {
    color: var(--text-secondary, #4a5568);
    background: rgba(100, 116, 139, .12);
    border-color: rgba(100, 116, 139, .2);
}

.sidebar-user-chevron {
    flex-shrink: 0;
    font-size: 11px;
    opacity: .5;
    transition: transform .2s;
}
.sidebar-user-trigger[aria-expanded="true"] .sidebar-user-chevron {
    transform: rotate(180deg);
}

/* collapsed: hide text + chevron */
.ombox-sidebar.collapsed .sidebar-user-info,
.ombox-sidebar.collapsed .sidebar-user-chevron { display: none; }

/* ── user panel popup ── */
.sidebar-user-panel {
    position: fixed;
    background: #ffffff;
    border: 1px solid rgba(0, 135, 247, .28);
    border-radius: 8px;
    box-shadow: 0 -6px 20px rgba(15, 23, 42, .12);
    color: var(--text-primary, #2d3748);
    padding: 6px;
    display: none;
    z-index: var(--z-modal);
    min-width: 160px;
}
.sidebar-user-panel[aria-hidden="false"] { display: block; }

.sidebar-user-panel-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
    transition: background .15s;
    text-align: left;
}
.sidebar-user-panel-item:hover {
    background: rgba(0, 135, 247, .08);
    color: #0087f7;
}
.sidebar-user-panel-item--danger { color: #f87171; }
.sidebar-user-panel-item--danger:hover { background: rgba(248,113,113,.12); }
.sidebar-user-panel-item--btn { width: 100%; }

.sidebar-user-panel-divider {
    height: 1px;
    background: rgba(0, 135, 247, .14);
    margin: 4px 0;
}

/* ========================================
   右侧 Sidebar (移动端快捷菜单)
   ======================================== */

.ombox-right-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-white, #ffffff);
    color: var(--text-primary, #2d3748);
    display: flex;
    flex-direction: column;
    z-index: 1060; /* 高于左侧 sidebar */
    border-left: 1px solid var(--border-color, #e2e8f0);
    box-shadow: -8px 0 28px rgba(15, 23, 42, 0.12);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ombox-right-sidebar.show {
    transform: translateX(0);
}

/* 桌面端隐藏右侧 sidebar */
@media (min-width: 768px) {
    .ombox-right-sidebar {
        display: none;
    }
}

/* 右侧 Sidebar Header */
.right-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-gray, #f8fafc);
}

.right-sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #2d3748);
    margin: 0;
}

.right-sidebar-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary, #6c757d);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.right-sidebar-close:hover {
    background: var(--bg-hover, #e9ecef);
    color: var(--text-primary, #2d3748);
}

/* 右侧 Sidebar Menu */
.right-sidebar-menu {
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 8px 0;
    overflow-y: auto;
}

.right-sidebar-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 16px 8px;
    color: var(--text-muted, #8a94a6);
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.04em;
}

.right-sidebar-divider::before,
.right-sidebar-divider::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: var(--border-color, #e2e8f0);
}

body.eye-protection .right-sidebar-divider {
    color: var(--text-muted, #7c897b);
}

body.eye-protection .right-sidebar-divider::before,
body.eye-protection .right-sidebar-divider::after {
    background: var(--border-color, #d7ddcf);
}

.right-sidebar-item {
    margin: 0;
    padding: 0;
}

.right-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-primary, #2d3748);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    min-height: 48px; /* 触摸友好 */
}

.right-sidebar-link:hover {
    background: var(--bg-hover, #f1f5f9);
    color: var(--text-primary, #2d3748);
    text-decoration: none;
}

.right-sidebar-icon {
    width: 20px;
    text-align: center;
    color: var(--text-secondary, #6c757d);
    flex-shrink: 0;
}

.right-sidebar-text {
    flex: 1;
}

/* 右侧 Sidebar 子菜单项缩进 */
.right-sidebar-subitem .right-sidebar-link {
    padding-left: 48px;
}

.right-sidebar-item.active .right-sidebar-link {
    background: var(--bg-primary-light, #e3f2fd);
    color: var(--primary-color, #0087F7);
    font-weight: 500;
}

/* 右侧 Sidebar Footer */
.right-sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-gray, #f8fafc);
}

.right-sidebar-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--danger-color, #dc3545);
    color: var(--danger-color, #dc3545);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px; /* 触摸友好 */
}

.right-sidebar-logout:hover {
    background: var(--danger-color, #dc3545);
    color: #ffffff;
}

/* 护眼模式适配 */
body.eye-protection .ombox-right-sidebar {
    background: var(--bg-card, #fbfefb);
    border-left-color: var(--border-color, #cfe3d2);
}

body.eye-protection .right-sidebar-header {
    background: var(--bg-gray, #edf7ee);
    border-bottom-color: var(--border-color, #cfe3d2);
}

body.eye-protection .right-sidebar-link:hover {
    background: var(--bg-hover, #e3f2e5);
}

body.eye-protection-sepia .ombox-right-sidebar {
    background: var(--bg-card, #FEFDFB);
    border-left-color: var(--border-color, #d4c4a8);
}

body.eye-protection-sepia .right-sidebar-header {
    background: var(--bg-gray, #F5F1E8);
    border-bottom-color: var(--border-color, #d4c4a8);
}

/* ========================================
   右侧菜单按钮 (Navbar)
   ======================================== */

.navbar-right-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary, #6c757d);
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

/* 桌面端隐藏（与 Bootstrap d-md-none 配合） */
@media (min-width: 768px) {
    .navbar-right-menu-toggle {
        display: none !important;
    }

    /* 桌面端：显示 footer */
    .ombox-page-footer {
        display: block !important;
    }

    /* 桌面端：隐藏中间 logo，显示左右区域 */
    .navbar-center {
        display: none !important;
    }

    nav.navbar .navbar-left,
    nav.navbar .navbar-page-left {
        display: flex !important;
    }

    nav.navbar .navbar-right,
    nav.navbar .navbar-page-right {
        display: flex !important;
    }
}

.navbar-right-menu-toggle:hover {
    background: var(--bg-gray, #f1f5f9);
    color: var(--text-primary, #2d3748);
}

.navbar-right-menu-toggle[aria-expanded="true"] {
    background: var(--bg-gray, #f1f5f9);
    color: var(--primary-color, #0087F7);
}

/* ========================================
   遮罩层增强
   ======================================== */

.sidebar-overlay[data-overlay-type="right"] {
    z-index: 1055; /* 在右侧 sidebar 之下 */
}

/* ========================================
   移动端 Navbar 居中 Logo
   ======================================== */

.navbar-left-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-primary, #2d3748);
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    border-radius: 4px;
}

.navbar-left-menu-toggle:hover {
    background: var(--bg-gray, #f1f5f9);
    color: var(--text-primary, #2d3748);
}

.navbar-left-menu-toggle:active {
    background: var(--bg-gray, #e2e8f0);
}

@media (max-width: 767.98px) {
    .navbar-left-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 移动端移除 navbar 的上下 padding，确保垂直居中 */
    nav.navbar,
    nav.navbar-fixed {
        padding: 0 !important;
    }

    nav.navbar .navbar-container {
        display: flex !important; /* 改回 flex 布局 */
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        padding: 0 8px !important; /* 左右各 8px */
        gap: 0 !important;
        height: 56px !important; /* 明确设置高度 */
    }

    nav.navbar .navbar-left {
        display: none !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 44px !important; /* 固定宽度 */
        flex-shrink: 0 !important;
    }

    .navbar-center {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        display: flex !important;
        justify-content: center;
        align-items: center;
        max-width: calc(100% - 96px);
        transform: translate(-50%, -50%) !important;
    }

    .navbar-center-logo {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        max-width: 100%;
        text-decoration: none;
    }

    .navbar-center-brand-name {
        display: none;
    }

    .navbar-center-logo img {
        height: 32px;
        width: auto;
        max-width: min(160px, calc(100vw - 112px));
        object-fit: contain;
    }

    nav.navbar .navbar-right {
        display: none !important;
        align-items: center !important;
        justify-content: flex-end !important;
        width: 44px !important; /* 固定宽度，与左侧一致 */
        flex-shrink: 0 !important;
    }

    /* 移动端隐藏 navbar-page-right（桌面端专用） */
    nav.navbar .navbar-page-right {
        display: none !important;
    }

    /* 隐藏桌面端的页面左侧内容区 */
    nav.navbar .navbar-page-left {
        display: none !important;
    }
}

/* ========================================
   Navbar 用户头像
   ======================================== */

.navbar-user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.navbar-user-trigger:hover {
    background: var(--bg-hover, #f1f5f9);
}

.navbar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

/* 桌面端用户菜单面板（复用 sidebar-user-panel） */
#navbarUserPanel {
    position: fixed;
    top: 60px;
    right: 16px;
    width: 240px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    display: none;
}

#navbarUserPanel[aria-hidden="false"] {
    display: block;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar-user-panel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary, #2d3748);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.navbar-user-panel-item:hover {
    background: var(--bg-hover, #f1f5f9);
}

.navbar-user-panel-item i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary, #6c757d);
}

.navbar-user-panel-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

.navbar-user-panel-item--danger {
    color: #dc3545;
}

.navbar-user-panel-item--danger:hover {
    background: #fff5f5;
    color: #c92a2a;
}

/* Shell width contract: desktop content and footer track the same sidebar rail. */
@media (min-width: 768px) {
    html:has(> body.ombox-shell) {
        height: 100%;
        overflow: hidden;
    }

    body.ombox-shell {
        height: 100vh;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    body.ombox-shell > .container {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    body.ombox-shell > .container > .content,
    body.ombox-shell > .container > .ombox-page-content {
        box-sizing: border-box;
        width: calc(100% - var(--sidebar-width, 240px));
        max-width: calc(100% - var(--sidebar-width, 240px));
        margin-left: var(--sidebar-width, 240px);
        height: 100%;
        min-height: 0;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        scrollbar-gutter: stable;
        overscroll-behavior: contain;
        transition: margin-left 0.3s ease, width 0.3s ease, max-width 0.3s ease;
    }

    body.ombox-shell.sidebar-collapsed > .container > .content,
    body.ombox-shell.sidebar-collapsed > .container > .ombox-page-content,
    body.ombox-shell > .container > .content.sidebar-collapsed,
    body.ombox-shell > .container > .ombox-page-content.sidebar-collapsed {
        width: calc(100% - var(--sidebar-collapsed-width, 64px)) !important;
        max-width: calc(100% - var(--sidebar-collapsed-width, 64px)) !important;
        margin-left: var(--sidebar-collapsed-width, 64px) !important;
    }

    body.ombox-shell .ombox-page-footer {
        box-sizing: border-box;
        left: auto;
        right: auto;
        width: calc(100% - var(--sidebar-width, 240px));
        margin-left: var(--sidebar-width, 240px) !important;
        transition: margin-left 0.3s ease, width 0.3s ease;
    }

    body.ombox-shell.sidebar-collapsed .ombox-page-footer {
        left: auto;
        right: auto;
        width: calc(100% - var(--sidebar-collapsed-width, 64px));
        margin-left: var(--sidebar-collapsed-width, 64px) !important;
    }

    body.ombox-shell .footer-container,
    body.ombox-shell.sidebar-collapsed .footer-container {
        margin-left: 0 !important;
    }
}

.footer-tool-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    min-height: 30px;
    padding: 0;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary, #718096);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.footer-tool-button span {
    display: none !important;
}

.footer-tool-button-text {
    width: auto;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.footer-tool-button-text span {
    display: inline !important;
}

.footer-tool-button.footer-tool-button-text:hover,
.footer-tool-button.footer-tool-button-text[data-active="true"] {
    border-color: transparent;
    background: transparent;
}

.footer-developer-button {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 9px;
    border: 1px solid rgba(0, 135, 247, .35);
    border-radius: 999px;
    background: rgba(0, 135, 247, .08);
    color: var(--primary-color, #0087f7);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
}

.footer-developer-button:hover,
.footer-developer-button:focus {
    background: rgba(0, 135, 247, .14);
    border-color: rgba(0, 135, 247, .5);
    color: var(--primary-dark, #0069c7);
    text-decoration: none;
}

.footer-debug-button {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 9px;
    border: 1px solid #d99a00;
    border-radius: 999px;
    background: #ffc107;
    color: #3d2c00;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
}

a.footer-debug-button:hover,
a.footer-debug-button:focus {
    background: #e0a800;
    border-color: #c48f00;
    color: #211800;
    text-decoration: none;
}

.footer-tool-button:hover,
.footer-tool-button[data-active="true"] {
    border-color: var(--primary-color, #0087f7);
    background: rgba(0, 135, 247, 0.08);
    color: var(--primary-color, #0087f7);
}

body.eye-protection .footer-tool-button {
    border-color: var(--border-color, #cfe3d2);
    color: var(--text-secondary, #52695a);
}

body.eye-protection .footer-tool-button:hover,
body.eye-protection .footer-tool-button[data-active="true"] {
    background: var(--bg-gray, #edf7ee);
    color: var(--primary-color, #4f9d69);
}

body.eye-protection .footer-tool-button.footer-tool-button-text,
body.eye-protection .footer-tool-button.footer-tool-button-text:hover,
body.eye-protection .footer-tool-button.footer-tool-button-text[data-active="true"] {
    border-color: transparent;
    background: transparent;
}

body.eye-protection .footer-developer-button {
    border-color: rgba(139, 107, 63, .42);
    background: rgba(139, 107, 63, .12);
    color: #76592f;
}

body.eye-protection .footer-developer-button:hover,
body.eye-protection .footer-developer-button:focus {
    border-color: rgba(139, 107, 63, .58);
    background: rgba(139, 107, 63, .18);
    color: #5f4524;
}

/* ========================================
   Shortcut Help Panel
   Framework-level styles for keyboard shortcut help overlays.
   ======================================== */

.ombox-shortcut-help-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal, 1200);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(2px);
}

.ombox-shortcut-help-overlay[hidden],
.ombox-shortcut-help-overlay[aria-hidden="true"] {
    display: none !important;
}

.ombox-shortcut-help-panel {
    width: min(720px, 100%);
    max-height: min(720px, calc(100vh - 48px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-md, 8px);
    background: var(--bg-white, #ffffff);
    color: var(--text-primary, #2d3748);
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}

.ombox-shortcut-help-header,
.ombox-shortcut-help-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-color: var(--border-color, #e2e8f0);
}

.ombox-shortcut-help-header {
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.ombox-shortcut-help-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-secondary, #718096);
    font-size: 13px;
}

.ombox-shortcut-help-title {
    margin: 0;
    color: var(--text-primary, #2d3748);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}

.ombox-shortcut-help-close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius-md, 8px);
    background: transparent;
    color: var(--text-secondary, #718096);
    cursor: pointer;
}

.ombox-shortcut-help-close:hover,
.ombox-shortcut-help-close:focus-visible {
    border-color: var(--border-color, #e2e8f0);
    background: var(--bg-gray, #f7fafc);
    color: var(--text-primary, #2d3748);
    outline: none;
}

.ombox-shortcut-help-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 20px 18px;
}

.ombox-shortcut-help-list {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
}

.ombox-shortcut-help-section {
    display: grid;
    gap: 8px;
}

.ombox-shortcut-help-section-title {
    margin: 12px 0 0;
    color: var(--text-secondary, #718096);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.ombox-shortcut-help-item {
    display: grid;
    grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-height: 44px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.ombox-shortcut-help-item:last-child {
    border-bottom: 0;
}

.ombox-shortcut-help-keys {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.ombox-shortcut-help-kbd,
.ombox-shortcut-help-keys kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    padding: 3px 8px;
    border: 1px solid var(--border-color, #cbd5e1);
    border-bottom-color: rgba(100, 116, 139, 0.55);
    border-radius: 6px;
    background: var(--bg-gray, #f8fafc);
    color: var(--text-primary, #1f2937);
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.08);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.ombox-shortcut-help-desc {
    min-width: 0;
    color: var(--text-primary, #2d3748);
    font-size: 14px;
    line-height: 1.45;
}

.ombox-shortcut-help-muted,
.ombox-shortcut-help-empty {
    color: var(--text-secondary, #718096);
    font-size: 13px;
    line-height: 1.5;
}

.ombox-shortcut-help-empty {
    padding: 24px 0;
    text-align: center;
}

body.eye-protection .ombox-shortcut-help-overlay,
body.eye-protection-sepia .ombox-shortcut-help-overlay {
    background: rgba(74, 60, 40, 0.34);
}

body.eye-protection .ombox-shortcut-help-panel,
body.eye-protection-sepia .ombox-shortcut-help-panel {
    border-color: var(--border-color, #d9cbb8);
    background: var(--bg-white, #faf8f3);
    color: var(--text-primary, #4a3c28);
    box-shadow: 0 24px 80px rgba(74, 60, 40, 0.18);
}

body.eye-protection .ombox-shortcut-help-header,
body.eye-protection .ombox-shortcut-help-footer,
body.eye-protection .ombox-shortcut-help-item,
body.eye-protection-sepia .ombox-shortcut-help-header,
body.eye-protection-sepia .ombox-shortcut-help-footer,
body.eye-protection-sepia .ombox-shortcut-help-item {
    border-color: var(--border-color, #d9cbb8);
}

body.eye-protection .ombox-shortcut-help-title,
body.eye-protection .ombox-shortcut-help-desc,
body.eye-protection .ombox-shortcut-help-kbd,
body.eye-protection .ombox-shortcut-help-keys kbd,
body.eye-protection-sepia .ombox-shortcut-help-title,
body.eye-protection-sepia .ombox-shortcut-help-desc,
body.eye-protection-sepia .ombox-shortcut-help-kbd,
body.eye-protection-sepia .ombox-shortcut-help-keys kbd {
    color: var(--text-primary, #4a3c28);
}

body.eye-protection .ombox-shortcut-help-footer,
body.eye-protection .ombox-shortcut-help-section-title,
body.eye-protection .ombox-shortcut-help-muted,
body.eye-protection .ombox-shortcut-help-empty,
body.eye-protection .ombox-shortcut-help-close,
body.eye-protection-sepia .ombox-shortcut-help-footer,
body.eye-protection-sepia .ombox-shortcut-help-section-title,
body.eye-protection-sepia .ombox-shortcut-help-muted,
body.eye-protection-sepia .ombox-shortcut-help-empty,
body.eye-protection-sepia .ombox-shortcut-help-close {
    color: var(--text-secondary, #6b5d4f);
}

body.eye-protection .ombox-shortcut-help-close:hover,
body.eye-protection .ombox-shortcut-help-close:focus-visible,
body.eye-protection-sepia .ombox-shortcut-help-close:hover,
body.eye-protection-sepia .ombox-shortcut-help-close:focus-visible {
    border-color: var(--border-color, #d9cbb8);
    background: var(--bg-gray, #f5f1e8);
    color: var(--text-primary, #4a3c28);
}

body.eye-protection .ombox-shortcut-help-kbd,
body.eye-protection .ombox-shortcut-help-keys kbd,
body.eye-protection-sepia .ombox-shortcut-help-kbd,
body.eye-protection-sepia .ombox-shortcut-help-keys kbd {
    border-color: var(--border-color, #d9cbb8);
    border-bottom-color: #c7b79f;
    background: var(--bg-gray, #f5f1e8);
    box-shadow: inset 0 -1px 0 rgba(74, 60, 40, 0.1);
}

@media (max-width: 575.98px) {
    .ombox-shortcut-help-overlay {
        align-items: flex-end;
        padding: 12px;
    }

    .ombox-shortcut-help-panel {
        max-height: calc(100vh - 24px);
    }

    .ombox-shortcut-help-header,
    .ombox-shortcut-help-footer {
        padding: 14px 16px;
    }

    .ombox-shortcut-help-body {
        padding: 6px 16px 16px;
    }

    .ombox-shortcut-help-item {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 8px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .ombox-shortcut-help-overlay:not([hidden]):not([aria-hidden="true"]) .ombox-shortcut-help-panel {
        animation: omboxShortcutHelpIn 0.16s ease-out;
    }
}

@keyframes omboxShortcutHelpIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
