/* fSelect - 多选下拉框插件样式 */

.fs-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
    font-size: 14px;
    line-height: 1.5;
}

.fs-label-wrap {
    position: relative;
    border: 1px solid var(--color-border-default);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    background: var(--color-canvas-default);
    transition: all 0.2s ease;
}

.fs-label-wrap:hover {
    border-color: var(--color-accent-fg);
}

.fs-label-wrap,
.fs-dropdown {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.fs-label-wrap .fs-label {
    padding: 8px 32px 8px 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    color: var(--color-fg-default);
    min-height: 36px;
    line-height: 20px;
}

.fs-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--color-fg-muted);
    position: absolute;
    top: 0;
    right: 12px;
    bottom: 0;
    margin: auto;
    transition: transform 0.2s ease;
}

.fs-wrap.open .fs-arrow {
    transform: rotate(180deg);
}

.fs-dropdown {
    position: absolute;
    background-color: var(--color-canvas-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--border-radius-md);
    margin-top: 4px;
    width: 100%;
    min-width: 200px;
    max-width: 400px;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    overflow: hidden; /* 防止内部元素超出边界 */
}

.fs-dropdown .fs-options {
    max-height: 240px;
    overflow-y: auto;
}

.fs-search {
    padding: 8px;
    border-bottom: 1px solid var(--color-border-muted);
}

.fs-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--color-border-default);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    outline: none;
    box-sizing: border-box; /* 确保 padding 和 border 包含在 width 内 */
}

.fs-search input:focus {
    border-color: var(--color-accent-fg);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

.fs-option,
.fs-optgroup-label {
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border-muted);
    cursor: pointer;
    transition: background 0.15s ease;
}

.fs-option:last-child {
    border-bottom: none;
}

.fs-option.hl {
    background-color: var(--color-canvas-subtle);
}

.fs-wrap.multiple .fs-option {
    position: relative;
    padding-left: 36px;
}

.fs-wrap.multiple .fs-checkbox {
    position: absolute;
    display: block;
    width: 36px;
    top: 0;
    left: 0;
    bottom: 0;
}

.fs-wrap.multiple .fs-option .fs-checkbox i {
    position: absolute;
    margin: auto;
    left: 12px;
    right: 0;
    top: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    border: 1px solid var(--color-border-default);
    border-radius: 3px;
    background-color: var(--color-canvas-default);
    transition: all 0.2s ease;
}

.fs-wrap.multiple .fs-option.selected .fs-checkbox i {
    background-color: var(--color-accent-fg);
    border-color: var(--color-accent-fg);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="white"><path d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px;
}

.fs-wrap .fs-option:hover {
    background-color: var(--color-canvas-subtle);
}

.fs-optgroup-label {
    font-weight: 600;
    color: var(--color-fg-muted);
    cursor: default;
}

.hidden {
    display: none;
}

/* 隐藏原生 select */
.visibility-hidden {
    position: absolute;
    visibility: hidden;
    pointer-events: none;
}

/* 按钮固定区域 */
.btnFixed {
    padding: 8px;
    border-top: 1px solid var(--color-border-muted);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    background: var(--color-canvas-subtle);
}

.btnFixed > .buttonDefault {
    padding: 4px 12px;
    background: var(--color-btn-bg);
    border: 1px solid var(--color-btn-border);
    border-radius: var(--border-radius-sm);
    color: var(--color-btn-text);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btnFixed > .buttonDefault:hover {
    background: var(--color-btn-hover-bg);
    border-color: var(--color-btn-hover-border);
}

.btnFixed > .buttonDefault:active {
    background: var(--color-btn-active-bg);
}

/* 选项标签 */
.fs-option-label {
    color: var(--color-fg-default);
    font-size: 14px;
}

/* 滚动条样式 */
.fs-options::-webkit-scrollbar {
    width: 8px;
}

.fs-options::-webkit-scrollbar-track {
    background: var(--color-canvas-subtle);
}

.fs-options::-webkit-scrollbar-thumb {
    background: var(--color-border-default);
    border-radius: 4px;
}

.fs-options::-webkit-scrollbar-thumb:hover {
    background: var(--color-border-muted);
}

