/**
 * 喜木首页 · 学易笔记（壳层与列表区；浮层/编辑仍用 liuyaoNotesEdit.css，此处做喜木主题覆盖）
 */

/* 卦例横版浮层：未打开时必须隐藏（缺 result-and-preview.css 时左下角喜木按钮会漏出） */
body.caiyun-page.ximu-page #liuyao-gua-layout-overlay:not(.is-open) {
    display: none !important;
}

body.caiyun-page.ximu-page.ximu-tab-notes {
    background: linear-gradient(160deg, #f8fafc 0%, #e2e8f0 100%);
}

/* 与首页一致：800px 白卡居中（layout-shell + ximustyle；此处补 margin 以防覆盖链缺失） */
body.caiyun-page.ximu-page.ximu-tab-notes .container {
    margin-left: auto;
    margin-right: auto;
}

body.caiyun-page.ximu-page.ximu-tab-notes .caiyun-main {
    max-width: 100%;
}

body.caiyun-page.ximu-page.ximu-tab-notes .notes-entry-container,
body.caiyun-page.ximu-page.ximu-tab-notes .notes-entry-list {
    width: 100%;
    max-width: none;
}

/* 只读笔记：喜木页始终全屏打开，避免先居中小窗再撑满 */
body.caiyun-page.ximu-page.ximu-tab-notes #liuyao-sheet-overlay {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    background: #fff;
}

body.caiyun-page.ximu-page.ximu-tab-notes #liuyao-sheet-overlay .liuyao-sheet-backdrop {
    display: none;
}

body.caiyun-page.ximu-page.ximu-tab-notes #liuyao-sheet-overlay .liuyao-sheet-box {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    min-height: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@supports (height: 100svh) {
    body.caiyun-page.ximu-page.ximu-tab-notes #liuyao-sheet-overlay .liuyao-sheet-box {
        width: 100svw;
        max-width: 100svw;
        height: 100svh;
        max-height: 100svh;
        min-height: 100svh;
    }
}

body.caiyun-page.ximu-page.ximu-tab-notes .ximu-notes-main {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 10px 8px;
    box-sizing: border-box;
}

/* 底栏导航之上固定笔记操作条 */
body.caiyun-page.ximu-page.ximu-tab-notes #notes-mode .notes-admin-container,
body.caiyun-page.ximu-page.ximu-tab-notes #notes-mode .notes-practice-inline-bar,
body.caiyun-page.ximu-page.ximu-tab-notes #notes-mode .notes-practice-return-bar {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    z-index: 190;
    border-top-color: rgba(22, 163, 74, 0.14);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -4px 16px rgba(22, 163, 74, 0.08);
}

body.caiyun-page.ximu-page.ximu-tab-notes #notes-mode .notes-section {
    padding-bottom: calc(var(--notes-action-bar-h) + 56px + env(safe-area-inset-bottom, 0px) + 12px);
}

body.caiyun-page.ximu-page.ximu-tab-notes #notes-mode .notes-practice-page {
    padding-bottom: calc(var(--notes-action-bar-h) + 56px + env(safe-area-inset-bottom, 0px) + 8px);
}

body.caiyun-page.ximu-page.ximu-tab-notes #ximu-page-notes.is-active {
    display: block;
    min-height: 0;
}

body.caiyun-page.ximu-page.ximu-tab-notes #notes-mode.mode-content {
    display: block;
}

body.caiyun-page.ximu-page.ximu-tab-notes .ximu-notes-card {
    padding: 12px 12px 16px;
    margin: 0;
}

body.caiyun-page.ximu-page.ximu-tab-notes .notes-section {
    padding: 0;
    text-align: left;
}

/* 分类 Tab：喜木绿 · 两行四列（7 项：上 4 + 下 3） */
#ximu-page-notes .notes-category-subtabs-row {
    max-width: none;
    margin: 0 0 14px;
    padding: 0;
    box-sizing: border-box;
}

#ximu-page-notes .notes-category-subtabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 6px;
    padding: 6px;
    background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid rgba(22, 163, 74, 0.22);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

#ximu-page-notes .notes-category-subtab {
    min-width: 0;
    padding: 8px 4px;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-size: 14px;
    white-space: nowrap;
    font-weight: 600;
    color: #14532d;
    cursor: pointer;
    font-family: inherit;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

#ximu-page-notes .notes-category-subtab:hover {
    color: #15803d;
    background: rgba(255, 255, 255, 0.55);
}

#ximu-page-notes .notes-category-subtab.is-active,
#ximu-page-notes .notes-category-subtab[aria-selected="true"] {
    color: #14532d;
    background: #fff;
    box-shadow:
        0 1px 3px rgba(15, 23, 42, 0.06),
        0 0 0 1px rgba(22, 163, 74, 0.22);
}

#ximu-page-notes .notes-category-subtab:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

@media (min-width: 768px) {
    #ximu-page-notes .notes-category-subtabs {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    #ximu-page-notes .notes-category-subtab {
        font-size: 15px;
        padding: 9px 6px;
    }
}

/* 笔记条目：卡片 chip，替代六爻 prayer-btn 观感 */
body.caiyun-page.ximu-page.ximu-tab-notes .notes-entry-list {
    justify-content: flex-start;
    gap: 8px 10px;
    padding: 2px 0 4px;
}

body.caiyun-page.ximu-page.ximu-tab-notes .notes-entry-empty {
    width: 100%;
    margin: 10px 0 2px;
    padding: 10px 8px;
    text-align: center;
    font-size: 14px;
    line-height: 1.5;
    color: #64748b;
}

body.caiyun-page.ximu-page.ximu-tab-notes .notes-entry-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center; 
    padding: 5px 14px;
    border-radius: 12px;
    border: 1px solid rgb(21 87 45 / 55%);
    background: linear-gradient(180deg, #ffffff 0%, #f7fdf9 100%);
    color: #000000;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.02em;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.95) inset,
        0 2px 8px rgba(22, 163, 74, 0.08);
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.12s ease;
}

body.caiyun-page.ximu-page.ximu-tab-notes .notes-entry-btn:hover {
    border-color: rgba(22, 163, 74, 0.35);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.95) inset,
        0 4px 14px rgba(22, 163, 74, 0.12);
}

body.caiyun-page.ximu-page.ximu-tab-notes .notes-entry-btn:active {
    transform: translateY(1px);
}

/* 编辑区 */
body.caiyun-page.ximu-page.ximu-tab-notes .notes-admin-container {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

body.caiyun-page.ximu-page.ximu-tab-notes .notes-admin-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

body.caiyun-page.ximu-page.ximu-tab-notes .notes-admin-bar .prayer-btn {
    min-height: 38px;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid rgba(22, 163, 74, 0.28);
    background: linear-gradient(165deg, #4ade80 0%, #22c55e 45%, #15803d 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(22, 163, 74, 0.22);
}

body.caiyun-page.ximu-page.ximu-tab-notes .notes-admin-bar .notes-admin-toggle {
    background: #fff;
    color: #15803d;
    border: 1px solid rgba(22, 163, 74, 0.28);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

/* 只读浮层标题栏：与喜木顶栏色系呼应 */
body.caiyun-page.ximu-page.ximu-tab-notes .liuyao-sheet-head {
    border-bottom: 1px solid rgba(244, 63, 94, 0.12);
}
 

body.caiyun-page.ximu-page.ximu-tab-notes .liuyao-sheet-share-btn {
    color: #15803d;
    border-color: rgba(22, 163, 74, 0.28);
}

body.caiyun-page.ximu-page.ximu-tab-notes .liuyao-page-toast {
    border-radius: 12px;
    border: 1px solid rgba(22, 163, 74, 0.2);
}

/* 笔记编辑/管理须盖住底栏、只读浮层与个人中心浮层（10050+） */
body.caiyun-page.ximu-page.ximu-tab-notes #notes-edit-overlay[aria-hidden="false"],
body.caiyun-page.ximu-page.ximu-tab-notes #notes-edit-overlay.notes-edit-overlay--above-gua-layout {
    z-index: 100220 !important;
}

body.caiyun-page.ximu-page.ximu-tab-notes #notes-admin-overlay[aria-hidden="false"] {
    z-index: 100210;
}

body.caiyun-page.ximu-page.ximu-notes-edit-stack-open #ximu-bottom-nav {
    visibility: hidden;
    pointer-events: none;
}

body.caiyun-page.ximu-page.ximu-tab-notes #notes-edit-overlay[aria-hidden="false"] .notes-edit-backdrop {
    background: #fff;
}
