/* 全局移动端/平板适配 */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
}

img, video, svg {
    max-width: 100%;
    height: auto;
}

pre, code {
    overflow-wrap: anywhere;
}

code {
    word-break: normal;
}

pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    word-break: normal;
}

table {
    max-width: 100%;
}

/* 笔记按钮：安全区域 + 避免与侧边栏按钮重叠 */
#study-notes-fab {
    right: max(16px, env(safe-area-inset-right, 16px));
    bottom: max(20px, env(safe-area-inset-bottom, 20px));
    z-index: 10002;
}

@media (max-width: 1024px) {
    .notes-toolbar {
        flex-wrap: wrap;
        gap: 6px;
    }

    .notes-tab-dl {
        margin-left: 0;
    }

    .notes-tab-close {
        margin-left: auto;
    }

    #notes-status {
        max-width: 55%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    #study-notes-fab {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}
