/**
 * 喜木底栏：主页 / 日历 / 笔记 / 我的（架构参考茶座 bottom-nav）
 */
#ximu-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #ffffff;
    border-top: 1px solid rgba(22, 163, 74, 0.18);
    box-shadow: 0 -4px 16px rgba(22, 163, 74, 0.08);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    z-index: 200;
    box-sizing: border-box;
}

#ximu-bottom-nav .ximu-bottom-nav-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 0.4vh;
    gap: 0;
    padding: 6px 4px 4px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease;
}

#ximu-bottom-nav .ximu-bottom-nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
    display: block;
    line-height: 1;
    color: #666666;
    transition: color 0.3s ease;
}

#ximu-bottom-nav .ximu-bottom-nav-item.is-active {
    color: #15803d;
    font-weight: 600;
}

#ximu-bottom-nav .ximu-bottom-nav-item.is-active i {
    color: #15803d;
}
 

body.ximu-has-bottom-nav .caiyun-footer {
    margin-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
}

/* 「我的」页不显示页脚（下载 APP、©喜木工作室） */
body.ximu-tab-profile .caiyun-footer {
    display: none !important;
}

body.ximu-tab-notes .caiyun-footer {
    display: none !important;
}

body.ximu-tab-calendar .caiyun-footer {
    display: none !important;
}

.ximu-tab-page {
    display: none;
}

.ximu-tab-page.is-active {
    display: block;
}

/* 日历 Tab 激活时用 flex 一屏布局（见 ximuCalendar.css） */
#ximu-page-calendar.is-active {
    display: flex;
    flex-direction: column;
}

#ximu-page-calendar:not(.is-active),
#ximu-page-calendar[hidden]:not(.is-active) {
    display: none !important;
}

/* 刷新时 sessionStorage 已选「我的」：在底栏 JS 运行前避免先露出主页 */
html.ximu-restore-profile #ximu-page-home {
    display: none !important;
}

html.ximu-restore-profile #ximu-page-profile {
    display: block !important;
}

html.ximu-restore-profile #ximu-page-profile[hidden] {
    display: block !important;
}

html.ximu-restore-profile .caiyun-footer {
    display: none !important;
}

/* 刷新时 sessionStorage / ?tab=notes / ?note= ：在底栏 JS 运行前避免先露出主页 */
html.ximu-restore-notes #ximu-page-home,
html.ximu-restore-notes #ximu-page-profile {
    display: none !important;
}

html.ximu-restore-notes #ximu-page-notes {
    display: block !important;
}

html.ximu-restore-notes #ximu-page-notes[hidden] {
    display: block !important;
}

html.ximu-restore-notes .caiyun-footer {
    display: none !important;
}

/* 刷新时 sessionStorage 已选「日历」 */
html.ximu-restore-calendar #ximu-page-home,
html.ximu-restore-calendar #ximu-page-profile,
html.ximu-restore-calendar #ximu-page-notes {
    display: none !important;
}

html.ximu-restore-calendar #ximu-page-calendar,
html.ximu-restore-calendar #ximu-page-calendar[hidden] {
    display: flex;
    flex-direction: column;
}

html.ximu-restore-calendar .caiyun-footer {
    display: none !important;
}

/* 八字记录/成员浮层须盖住个人中心（与梅花卦录 100010+ 同级） */
body.caiyun-page.ximu-page .caiyun-settings-overlay.show,
body.caiyun-page.ximu-page .caiyun-records-overlay.show {
    z-index: 100200;
}

body.caiyun-page.ximu-page .caiyun-settings-panel,
body.caiyun-page.ximu-page .caiyun-records-panel {
    z-index: 100201;
}
