/* 基础项组件 */

html {
    --base-item-color-text: rgba(0, 0, 0, 0.7);
    --base-item-color-text-active: rgba(0, 0, 0, 1);
    --base-item-color-bg-hover: rgba(0, 0, 0, 0.1);
    --base-item-color-bg-active: rgba(0, 0, 0, 0.2);
    --base-item-color-selected-text: rgba(0, 0, 0, 1);
    --base-item-color-selected-bg: rgba(0, 0, 0, 0.2);
}

html.dark {
    --base-item-color-text: rgba(255, 255, 255, 0.7);
    --base-item-color-text-active: rgba(255, 255, 255, 1);
    --base-item-color-bg-hover: rgba(255, 255, 255, 0.1);
    --base-item-color-bg-active: rgba(255, 255, 255, 0.2);
    --base-item-color-selected-text: rgba(255, 255, 255, 1);
    --base-item-color-selected-bg: rgba(255, 255, 255, 0.2);
}

.base-item {
    padding: 0 10px;
    cursor: pointer;
    border-radius: 6px;
    transition: none;
    height: 30px;
    display: flex;
    align-items: center;
    background-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.base-item--draggable {
    cursor: grab;
}

.base-item--draggable:active {
    cursor: grabbing;
}

.base-item--dragging {
    opacity: 0.98;
    transform: scale(1.02);
    background-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
    transition:
        opacity 0.12s ease,
        transform 0.12s ease,
        box-shadow 0.12s ease,
        background-color 0.12s ease;
}

.base-item--ghost {
    visibility: hidden;
    pointer-events: none;
}

.base-item,
.base-item .base-item__icon-wrapper .svg-icon,
.base-item .base-item__name,
.base-item .base-item__status-icon {
    color: var(--base-item-color-text);
}

.base-item:hover {
    background-color: var(--base-item-color-bg-hover);
}

/* 拖拽排序期间关闭列表项自身反馈，避免与跟随鼠标的浮层产生双重高亮。 */
.base-item--feedback-suppressed:hover {
    background-color: transparent;
}

.base-item:active {
    background-color: var(--base-item-color-bg-active);
}

.base-item--feedback-suppressed:active {
    background-color: transparent;
}

.base-item:active,
.base-item:active .base-item__icon-wrapper .svg-icon,
.base-item:active .base-item__name,
.base-item:active .base-item__status-icon {
    color: var(--base-item-color-text-active);
}

.base-item--feedback-suppressed:active,
.base-item--feedback-suppressed:active .base-item__icon-wrapper .svg-icon,
.base-item--feedback-suppressed:active .base-item__name,
.base-item--feedback-suppressed:active .base-item__status-icon {
    color: var(--base-item-color-text);
}

.base-item--selected {
    background-color: var(--base-item-color-selected-bg);
}

.base-item--selected,
.base-item--selected .base-item__icon-wrapper .svg-icon,
.base-item--selected .base-item__name,
.base-item--selected .base-item__status-icon {
    color: var(--base-item-color-selected-text);
}

.base-item--feedback-suppressed.base-item--selected:active {
    background-color: var(--base-item-color-selected-bg);
}

.base-item--feedback-suppressed.base-item--selected:active,
.base-item--feedback-suppressed.base-item--selected:active .base-item__icon-wrapper .svg-icon,
.base-item--feedback-suppressed.base-item--selected:active .base-item__name,
.base-item--feedback-suppressed.base-item--selected:active .base-item__status-icon {
    color: var(--base-item-color-selected-text);
}

.base-item__default {
    color: inherit;
}

.base-item__content {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
}

.base-item__left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.base-item--has-right-content {
    padding-right: 8px;
}

.base-item__right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* 基础项内部元素样式 */
.base-item__icon-wrapper {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.base-item__icon-wrapper .svg-icon {
    width: 16px !important;
    height: 16px !important;
}

.base-item__icon-wrapper img {
    width: 16px;
    height: 16px;
}

.base-item__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    object-fit: contain;
}

.base-item__name {
    font-size: var(--uosai-font-size-base);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.base-item__status-icon {
    flex-shrink: 0;
}
