/**
 * 自定义复选框样式
 * 统一的复选框组件，支持亮色/暗色主题
 */

/* 隐藏原生复选框 */
.custom-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* 复选框容器 */
.custom-checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

/* 自定义复选框外观 */
.custom-checkbox-box {
    position: relative;
    width: 20px;
    height: 20px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0px 1px 2px 0px rgba(128, 128, 128, 0.1);
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 对勾图标（默认隐藏） */
.custom-checkbox-box::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M10 3L4.5 8.5L2 6" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

/* 复选框标签文字 */
.custom-checkbox-label {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 12px;
    line-height: 20px;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.2s ease;
}

/* Hover 状态 */
.custom-checkbox-wrapper:hover .custom-checkbox-box {
    border-color: var(--primary-green);
    box-shadow: 0px 1px 4px 0px rgba(33, 189, 98, 0.2);
}

/* 选中状态 */
.custom-checkbox:checked + .custom-checkbox-box {
    background-color: #21BD62;
    border-color: #21BD62;
    box-shadow: 0px 1px 4px 0px rgba(33, 189, 98, 0.3);
}

.custom-checkbox:checked + .custom-checkbox-box::after {
    opacity: 1;
    transform: scale(1);
}

/* Focus 状态（键盘导航） */
/* .custom-checkbox:focus + .custom-checkbox-box {
    outline: 2px solid rgba(33, 189, 98, 0.3);
    outline-offset: 2px;
} */

/* 禁用状态 */
.custom-checkbox:disabled + .custom-checkbox-box {
    background-color: var(--bg-disabled);
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.5;
}

.custom-checkbox:disabled ~ .custom-checkbox-label {
    color: var(--text-disabled);
    cursor: not-allowed;
    opacity: 0.5;
}

.custom-checkbox-wrapper:has(.custom-checkbox:disabled) {
    cursor: not-allowed;
}

/* 暗色模式特定调整 */

[data-theme="dark"] .custom-checkbox:checked + .custom-checkbox-box {
    background-color: #21BD62;
    border-color: #21BD62;
}

[data-theme="dark"] .custom-checkbox-label {
    color: #DEE0E4;
}

/* 响应式调整 */
@media (max-width: 639px) {
    .custom-checkbox-wrapper {
        gap: 10px;
    }
    
    .custom-checkbox-box {
        width: 18px;
        height: 18px;
    }
    
    .custom-checkbox-box::after {
        width: 10px;
        height: 10px;
    }
    
    .custom-checkbox-label {
        font-size: 11px;
    }
}
