:root{
    --as-accent: var(--tagz-accent, #4da3ff);
    --as-bg: rgba(0, 0, 0, 0.8);
    --as-bg-btn: #555;
}

#tagz-edit-toolbar {
    position: absolute;
    top: 0;
    left: 0;
    inset: 0;
    pointer-events: none;
    z-index: 99999;

    & .tagz-edit-toolbar-highlight {
        position: absolute;
        border: 2px solid var(--tagz-accent);
        background: hsl(from var(--tagz-accent) h s l / 10%);
        display: none;
        pointer-events: none;
        box-sizing: border-box;

    }

    & .tagz-edit-toolbar-btns {
        position: absolute;
        display: none;
        background-color: transparent;
        border-radius: 6px;
        padding: 4px 4px 8px 4px;
        gap: 4px;
        pointer-events: auto;
        flex-direction: row;
        justify-content: flex-end;

    }

}

#tagz-mini-bar {
    position: fixed;
    z-index: 2000;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;

    background: var(--as-bg);
    padding: 6px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);

    width: auto;
    /* 固定最小宽度，避免缩放怪异 */
    min-width: 200px;
    max-width: 90%;
    cursor: default;

    &.direction-right,
    &.direction-left {
        flex-direction: column;
        width: 56px;
        min-width: unset;
        max-width: unset;
        gap: 10px;

        top: 50%;
        left: unset;
        right: 10px;
    }

    &.direction-left {
        right: unset;
        left: 10px;
    }


    /* 拖动手柄 */
    & .drag-handle {
        cursor: grab;
        padding: 0 6px;
        font-size: 16px;
        display: flex;
        align-items: center;
        user-select: none;

        touch-action: none;
        /* 关键：防止移动端触发滚动 */

        color: #fff9;
        flex-shrink: 0;
    }

    & button {
        padding: 5px 14px;
        font-size: 12px;
        flex-shrink: 0;
        /* 避免按钮随容器缩小 */
    }

    &.direction-right button {
        width: 42px;

    }

}


#tagz-mini-bar button,
#tagz-edit-toolbar button
{
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-color: var(--as-bg-btn);
    color: #fff;
    border: none;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;

    &:hover {
        background-color: var(--as-accent);
    }
}
